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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|