Hi Sprinks:
Thank you for your help. Actually, it is a little bit more difficult. When
the query returns the records set, say 10 records, I would like all of them
are displayed on the single form, in a text box: txtString (or text boxes)
with the code (sample) as following,
If Me![Student] = "1st Grade" Then
Me.txtString = "Your class" & [Value1] & " on " & [Value2] & " #"
& [Value3] & "."
ElseIf Me![Student] = "2nd Grade" Then
Me.txtString = "Your class " & [Value1] & " by " & [Value2] & " ."
Else
Me.txtString = " "
End If
The problem is the form just show the first value of Student and then the
same value is showed for all records. But I need to show various statement on
the txtString based on the query. In addtion, txtString is empty if [Student]
value is empty. Can you please show me how to do that?
Thank you a lot. T.
Sprinks said:
Tim,
If you mean you'd like to open a form displaying results from the query, set
the form's RecordSource to the query, being sure to include all fields in the
query that are in the current RecordSource. You can do this on the fly, say,
attached to a button, by:
stDocName = "YourFormName"
DoCmd.OpenForm stDocName
Forms!YourFormName.RecordSource = "BatchesQuery"
Hope that helps.
Sprinks
:
I have a query and when I run it, two dialog pops up asking to enter two
values. Base on these values, the query will return all records meeting the
conditions. Now, I want to "catch" these values and use them as criteria to
manipulate data from the query and show corresponding records on the form.
Can you show me how to do it?
Thank you,