A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query with Form as a parameter



 
 
Thread Tools Display Modes
  #1  
Old November 27th, 2006, 05:26 PM posted to microsoft.public.access.queries
Amy
external usenet poster
 
Posts: 8
Default Query with Form as a parameter

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]
  #2  
Old November 27th, 2006, 05:37 PM posted to microsoft.public.access.queries
MJatAflac
external usenet poster
 
Posts: 15
Default Query with Form as a parameter

Are you trying to open the form from the query?
--
Michal Joyce
Project Management IS Analyst
Aflac - Project Management Office


"Amy" wrote:

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]

  #3  
Old November 27th, 2006, 05:41 PM posted to microsoft.public.access.queries
Amy
external usenet poster
 
Posts: 8
Default Query with Form as a parameter

Yes. When the user runs the query, the form should open to allow them to
enter the employee whose information they would like to review.

"MJatAflac" wrote:

Are you trying to open the form from the query?
--
Michal Joyce
Project Management IS Analyst
Aflac - Project Management Office


"Amy" wrote:

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]

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

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]



  #5  
Old November 27th, 2006, 05:53 PM posted to microsoft.public.access.queries
Amy
external usenet poster
 
Posts: 8
Default Query with Form as a parameter

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]




  #6  
Old November 27th, 2006, 06: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]






  #7  
Old November 27th, 2006, 06:31 PM posted to microsoft.public.access.queries
Amy
external usenet poster
 
Posts: 8
Default Query with Form as a parameter

Thanks John! I have reviewed all of the spelling and it is correct. I
entered the criteria using the build feature. It still doesn't seem to
recognize the form. Maybe i will need to start all over. Thanks!

"John Spencer" wrote:

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]






  #8  
Old November 27th, 2006, 06:46 PM posted to microsoft.public.access.queries
MJatAflac
external usenet poster
 
Posts: 15
Default Query with Form as a parameter

You might try opening your form in design view and then use the build feature
to point to it. This way it shows up in the loaded forms folder. I've seen
this kind of thing before when I used forma that weren't currently loaded
when I built my query.
--
Michal Joyce
Project Management IS Analyst
Aflac - Project Management Office


"Amy" wrote:

Thanks John! I have reviewed all of the spelling and it is correct. I
entered the criteria using the build feature. It still doesn't seem to
recognize the form. Maybe i will need to start all over. Thanks!

"John Spencer" wrote:

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]






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.