View Single Post
  #6  
Old November 27th, 2006, 05:05 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Query with Form as a parameter

In that case, check your spelling on the name of the control. If you have
spelled the name of the control one way on the form and slightly different
in the query, Access will display an input parameter box since it cannot
find what you are asking for.

Forms![EmployeeParam]![cboEmployee]
So, is the form named EmployeeParam?
Is the combobox named CboEmployee?

I've not stepped through the example, but it appears to be detailed and
correct.


"Amy" wrote in message
...
I think maybe I haven't explained it correctly. I have used the tips found
at http://www.fontstuff.com/access/acctut08.htm to help me set it up.
Only,
when I get to step 2.3, it doesn't work. When it brings up a regular
parameter box instead of the form that I have built. Has anyone ever used
these instructions?

"John Spencer" wrote:

You cannot call a form from a query. You can call a query from a form
using
VBA on a button's click event.

Open the form
Select the employee
Press the button. In the code behind the button's click event you would
have something like

DoCmd.OpenQuery "YourQueryName"


To add the code to the button,
open the form in design mode,
Right-click on the button,
Show properties, click on the events tab,
in the OnClick event select [Event Procedure],
click on the three dots at the end and enter the code above (replace
YourQueryName and keep the quote marks).


"Amy" wrote in message
...
Hi! I have created a small form with a combo box which I am using in
a
query. However, when I call the form from the query criteria, it is
not
bringing up the actual form that I have built. It brings up a regular
parameter box that reads exactly what was put into the criteria field
of
the
query. What am I doing wrong?

Here is what I have in the query criteria:
Forms![EmployeeParam]![cboEmployee]