How do I code a button on a form to run a query and display the results in a
text box (on the current form)?
thank you!
How many records are returned by the query?
If just one all you need to display one field is:
[ControlName] = DLookUp("[FieldName]","QueryName")
If more than one record is returned, you can display one field, as
above, but you must add criteria (Where clause) to the DLookUp to get
the correct record.
If you need to see all the records, create a form to display them in.
Use the query as record source.
Then code a command button on a form:
DoCmd.OpenForm "FormName"