By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,121 Members | 1,706 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,121 IT Pros & Developers. It's quick & easy.

getting criteria match from other form's textbox

P: 7
hi, just wondering how can i get a value from a text box on a different form to apply in a query, can i do this in query criteria? or i have to make a vb code in command click?

i have a form with a textbox, and a command click, what i want, once click it will open a query form base on the value of the textbox, it would be easy if i could use the query criteria part but seems like i cant do that, so i might need a vb code advise if ever i wont be able to do this, thanks
Jan 7 '08 #1
Share this Question
Share on Google+
1 Reply


Megalog
Expert 100+
P: 378
I do this all the time... In your query, in the Criteria box, put:
[Forms]![FormName]![ControlName]

For example, say the Query is looking up Employee information, and you want it to filter out only the relevant information for the employee you have selected in a combo box.

Form: frmEmployeeDetails
Control: cboEmployeeFilter

you'd use this as your criteria:
[Forms]![frmEmployeeDetails]![cboEmployeeFilter]

Now, this only works if that referenced form is open obviously, so use this criteria only in cases where something is being called from an open form.
Jan 7 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.