View Full Version : Auto entering criteria


The Red Star
09-09-2001, 11:12 AM
I have a query, which searches through a table to find information , as queries do.
The problem for me however, is that i need the criteria for the query to come from a form. The query will be run as part of the opening of the said form. (the query is where the information for a subtable in the form comes from).

I tried building the criteria, but everytime i open it, it asks for the parameter value.
Any help?

jwindon
09-09-2001, 11:29 AM
Criteria for forms is:

=forms![formName]![FieldName]

What field on your main form is being compared for your query? It sounds like the order things are running is the culprit here.

R. Hicks
09-09-2001, 11:56 AM
Search Access help files for "OpenForm Method". You can provide a "Where" criteria as an argument of this method.

Here is an example:
DoCmd.OpenForm "frmEmpInfo", , , "Emp_ID =" & Me![cboEmployee].Column(0)

HTH
RDH

[This message has been edited by R. Hicks (edited 09-09-2001).]

The Red Star
09-10-2001, 01:39 AM
Thanks for your help everyone. I'll try them out, and see what i come up with.

Tim Stevenson