List box in query (1 Viewer)

$t3ff

Registered User.
Local time
Tomorrow, 08:05
Joined
Feb 15, 2008
Messages
13
I have created a database showing the results for a number of events with long and complicated names.

In the database is a query which select the first, second and third for each event, I would like to have it show each event seperately unfortunatly the number of events is to large to create a seperate query and report for each one.

Is it possible to have a parameter query asking for the event name where instead of the user just entering the name of the event, can they pick the event from a dropdown list?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:05
Joined
Aug 30, 2003
Messages
36,126
You would need to create a form with a combo or list box, and have the query look at that, so instead of a criteria of:

[whatever]

you'd have

Forms!FormName.ControlName
 

$t3ff

Registered User.
Local time
Tomorrow, 08:05
Joined
Feb 15, 2008
Messages
13
Where abouts do I put the
Forms!FormName.ControlName
is it in the criteria of the heading Event?

So Event field from tblEvents with criteria of Forms!FormName.ControlName?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:05
Joined
Aug 30, 2003
Messages
36,126
Yes; have you tried it?
 

$t3ff

Registered User.
Local time
Tomorrow, 08:05
Joined
Feb 15, 2008
Messages
13
Have tried it, came up with a parameter box asking
Forms!frmEvents.Event
Checked this aganist the field names in the form/table and they were correct
Not a list box but if i entered the correct name of an event it did work
What am I doing wrong?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:05
Joined
Aug 30, 2003
Messages
36,126
The form would need to be open; is it? If so, double check the spelling of the form and the control (not the field).
 

$t3ff

Registered User.
Local time
Tomorrow, 08:05
Joined
Feb 15, 2008
Messages
13
Have checked the spelling of the control source still comming up with the same thing.

The form is created off a table of events the form just serving the purpose of entering data into the table therefore the control sorce is the field name, properties confirms this.

Do i need to create a new field in the form in some way and link that to the tbl of events?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:05
Joined
Aug 30, 2003
Messages
36,126
Can you post a sample db? I suspect we are not talking about the same thing. I'm referring to the name of the control (textbox, combobox, etc), not its control source.
 

$t3ff

Registered User.
Local time
Tomorrow, 08:05
Joined
Feb 15, 2008
Messages
13
I know understand what you mean by having the form open (shows how dumb i am).

It was not what i was thinking so each time i tried it, it would not work, i have now just put a button on the form which links to a report which is based on the query, solving my problem.

Thank-you for your help
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 15:05
Joined
Aug 30, 2003
Messages
36,126
It's not dumb to not know something yet. Glad we got it sorted out for you.
 

Users who are viewing this thread

Top Bottom