Link a form to a query

  • Thread starter Thread starter chspit
  • Start date Start date
C

chspit

Guest
I have created a form and I want it to act as the interface to a query, i.e. i want to enter the 'criteria' from the text boxes in this form and run the query from this form. So how can I link the textboxes in the form to the 'criteria' fields in the query?

Thanks in advance for your help.
 
In your query add the following to the criteria:

[Forms]![Your Form Name]![Your Text box name]

Pete
 
Thanks Pete! It works.
However, it works only if all the textboxes in the form are filled in. But what if I want to leave some textboxes empty. If I leave a textbox empty, the query won't work.
Also, can I perform wildcards with your method (e.g. *something) in the textboxes?
 
use the following to fix the problem with no data entered

[Forms]![Your Form Name]![Your Text box name] Or [Forms]![Your Form Name]![Your Text box name] Is Null

I don't know about the wild cards though sorry,

Regards

Pete
 

Users who are viewing this thread

Back
Top Bottom