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
|
|||
|
|||
Combo box use as a Query... any help
I have a query (qryTrainingByTile) and a form (frmUpcomingTraining). In the
form is a combo box (Select Title) that selects the title record from a separate table (tblJobTitles), there is also a button with a macro that open the query when is clicked. I need the query to use the title selected from the combo box as a criteria when clicking the button to open the query. Any ideas... thank you |
#2
|
|||
|
|||
Combo box use as a Query... any help
If you open the query from the user interface, or as record source of a
form/report, or as row source of another combo box/list box, then use FORMS!theFormNameHere!TheComboBoxNameHere syntax as criteria. Example: SELECT * FROM someTable WHERE someField FORMS!theFormNameHere!TheComboBoxNameHere If any name if ill-formed, you need to use [ ] around it: SELECT * FROM someTable WHERE someField FORMS![My form one]![Select something] for the form My Form One and the combo box Select Something. Hoping it may help, Vanderghast, Access MVP "fossy" wrote in message ... I have a query (qryTrainingByTile) and a form (frmUpcomingTraining). In the form is a combo box (Select Title) that selects the title record from a separate table (tblJobTitles), there is also a button with a macro that open the query when is clicked. I need the query to use the title selected from the combo box as a criteria when clicking the button to open the query. Any ideas... thank you |
#3
|
|||
|
|||
Combo box use as a Query... any help
Ok... I am so lost
everytime i try any kind ot expression on the expression builder it says sintax error i don;t know if I'm typing it wrong some like that Help plz... Note: the is no table for the form where the combobox is located... It is just a form use as user interface where the user will select from the combo box and then click on the button to bring up the results. "Michel Walsh" wrote: If you open the query from the user interface, or as record source of a form/report, or as row source of another combo box/list box, then use FORMS!theFormNameHere!TheComboBoxNameHere syntax as criteria. Example: SELECT * FROM someTable WHERE someField FORMS!theFormNameHere!TheComboBoxNameHere If any name if ill-formed, you need to use [ ] around it: SELECT * FROM someTable WHERE someField FORMS![My form one]![Select something] for the form My Form One and the combo box Select Something. Hoping it may help, Vanderghast, Access MVP "fossy" wrote in message ... I have a query (qryTrainingByTile) and a form (frmUpcomingTraining). In the form is a combo box (Select Title) that selects the title record from a separate table (tblJobTitles), there is also a button with a macro that open the query when is clicked. I need the query to use the title selected from the combo box as a criteria when clicking the button to open the query. Any ideas... thank you |
#4
|
|||
|
|||
Combo box use as a Query... any help
If you are defining your query in the query designer, then you type the
criteria, in the grid, under the field (or expression) to be compared, and at the Criteria line. The word FORMS is to be typed as it is, with the two !, but supply your form name and your control (combo box) name. Be sure the form is open, and the combo box has some value then, run (view data) the query you just defined. Should work, nothing more complex than that is involved. Vanderghast, Access MVP "fossy" wrote in message ... Ok... I am so lost everytime i try any kind ot expression on the expression builder it says sintax error i don;t know if I'm typing it wrong some like that Help plz... Note: the is no table for the form where the combobox is located... It is just a form use as user interface where the user will select from the combo box and then click on the button to bring up the results. "Michel Walsh" wrote: If you open the query from the user interface, or as record source of a form/report, or as row source of another combo box/list box, then use FORMS!theFormNameHere!TheComboBoxNameHere syntax as criteria. Example: SELECT * FROM someTable WHERE someField FORMS!theFormNameHere!TheComboBoxNameHere If any name if ill-formed, you need to use [ ] around it: SELECT * FROM someTable WHERE someField FORMS![My form one]![Select something] for the form My Form One and the combo box Select Something. Hoping it may help, Vanderghast, Access MVP "fossy" wrote in message ... I have a query (qryTrainingByTile) and a form (frmUpcomingTraining). In the form is a combo box (Select Title) that selects the title record from a separate table (tblJobTitles), there is also a button with a macro that open the query when is clicked. I need the query to use the title selected from the combo box as a criteria when clicking the button to open the query. Any ideas... thank you |
Thread Tools | |
Display Modes | |
|
|