Dynamic Form: display query result and update based on form entrie

Dynamic Form: display query result and update based on form entrie

Post by QnJ5YW » Thu, 26 Mar 2009 23:28:01


I have a form that I use combo-boxes to select query parameters. I want to
display the result of a query within the same form once the query is
initiated from a button on the form.

Thanks!
 
 
 

Dynamic Form: display query result and update based on form entrie

Post by Stev » Fri, 27 Mar 2009 02:19:33

Create a table named TblDummy with all the same field names as your query.
The table should have no records. Create your form setting the recordsource
to TblDummy. This will prevent an error from occurring when the form opens
and no data will be displayed on the form at this point. Add your comboboxes
to either the form's header or footer. Add your button in an appropriate
place. Assuming your existing query is named QryMyQuery, put the following
code in the Click event of the button:
Me.Recordsource = "QryMyQuery"

Steve
XXXX@XXXXX.COM