|
Prev: PivotTable View
Next: User Select Top Value Percentage
From: fossy on 2 Jul 2008 14:22 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
From: Michel Walsh on 2 Jul 2008 14:28 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" <fossy(a)discussions.microsoft.com> wrote in message news:0E75F9A4-D549-4AB2-8437-A6994BA1B389(a)microsoft.com... >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
From: fossy on 2 Jul 2008 17:58 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" <fossy(a)discussions.microsoft.com> wrote in message > news:0E75F9A4-D549-4AB2-8437-A6994BA1B389(a)microsoft.com... > >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 > > >
From: Michel Walsh on 3 Jul 2008 09:03 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" <fossy(a)discussions.microsoft.com> wrote in message news:712D0376-7BD4-4306-BFAC-3C9594DDF971(a)microsoft.com... > 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" <fossy(a)discussions.microsoft.com> wrote in message >> news:0E75F9A4-D549-4AB2-8437-A6994BA1B389(a)microsoft.com... >> >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 >> >> >>
|
Pages: 1 Prev: PivotTable View Next: User Select Top Value Percentage |