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  

Combo box use as a Query... any help



 
 
Thread Tools Display Modes
  #1  
Old July 2nd, 2008, 07:22 PM posted to microsoft.public.access.queries
fossy
external usenet poster
 
Posts: 13
Default 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  
Old July 2nd, 2008, 07:28 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default 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  
Old July 2nd, 2008, 10:58 PM posted to microsoft.public.access.queries
fossy
external usenet poster
 
Posts: 13
Default 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  
Old July 3rd, 2008, 02:03 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default 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

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 08:02 AM.


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