Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Criteria based on whether form is open or closed

Status
Not open for further replies.

naiku

Technical User
Apr 25, 2002
346
US
I have a query which I want to either take it's criteria from either a text box on an open form (the user can click a button on the form to open the query) or I want for it to ask the user for an ID number (I also want the option to open the query from a main menu type screen with the form closed)

I tried entering in the Criteria for the query [Forms]![MyForm]![IDNumber] Or [Please enter ID number] but this asks for both inputs. Is there a way I can have one or the other?

Thanks.
 
if you set the criteria to the explicit control name on the form, i.e. [Forms]![MyForm]![IDNumber], then if the form isn't open, activating the query will open a input box which prompts you for the value... you can try putting an AS on the criteria to get it to come up [please enter ...] but I'm not sure if it'll work.

this will apply with the button as well, if you just make the button open up the query, but do NOT have the input control on the same form as the button, then the input box will also popup

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top