I would use an unbound combo box to select the
records/date I wanted to display. The RowSource property
of the combo box would be similar to the form's
RecordSource property but also using either GroupBy or
Unique Records.
In the AfterUpdate_Event, for the combo box build a
dynamic query string {strSQL} where the date selected from
the combo box is used as a criteria for the dynamic query.
Note: If you do not know how to do this, you should learn.
The technique, once you have earned it, is easy to
implement and very "powerful/useful".
Use this code after you have created the dynamic query
string: Me.RecordSource = strSQL
The form will only contain/display the records associated
with the date you selected.
You can also set the form's Recordset property to a
recordset: Me.Recordset = rstTemp; if the recordset
produced by your code below is already what you want.
Quote:
>-----Original Message-----
>Normally I'd use a form or subform in continuous forms
view, and dynamically
Quote:
>manipulate its RecordSource property so as to show the
records I want.
>Another possibility is a list box, in which case it's the
RowSource property
>you'd set to the SQL statement you've built.
>--
>Dirk Goldgar, MS Access MVP
>www.datagnostics.com
>(please reply to the newsgroup)
>> Hello,
>> I'm trying to display multiple records. The number of
>> records to be displayed is based on the results of a
query
>> with a parameter of date that I select from a drop down.
>> because the resulting number of records vary, I would
like
>> to only show the results that are returned. How do I
make
>> a dynamic display.
>> Right now the code below only allows me to show the last
>> line of the result. Thanks in advance for your help
>> This is the code that I'm running
>> Set qdf = dbs.CreateQueryDef("", strSQL)
>> With qdf
>> Set rstTemp = .OpenRecordset()
>> 'rstTemp.MoveFirst
>> Do While Not rstTemp.EOF
>> field1.Value = rstTemp.Fields("field1")
>> field2.Value = rstTemp.Fields("field2")
>> field3.Value = rstTemp.Fields("field3")
>> field4.Value = rstTemp.Fields("field4")
>> field5.Value = rstTemp.Fields("field5")
>> rstTemp.MoveNext
>> Loop
>> rstTemp.Close
>> End With
>> qdf.Close
>.