Create Dynamic Query from a form

aromano789

Registered User.
Local time
Today, 01:50
Joined
Feb 9, 2008
Messages
12
Im looking to have user customized query based on a form

Want to have a drop down with the field name then create a query like....

SELECT Table.id, StudentMasterFile.[forms]![form1]![Unbound]FROM Table;


That does not work....but can someone guide me in the right direction

Thanks
 
it's easiest to base your form on a query. in the query, add criteria that references your combobox: Criteria: Forms!frmYourForm!cboSelect. in the afterupdate of the combobox, requery the form.

you can do it the way you started to do it also. select... WHERE x=forms!...

or, create the query in the query designer, view SQL and copy the SQL.
 
you can also populate your textbox using Dlookup for example

Me.txtBoxName.Value = DLookup("[FieldNameFromQuery]", "QueryName")

hope this helps
 

Users who are viewing this thread

Back
Top Bottom