Multiple Combo Boxes - Got 2 out of 3 working

V

visionstate

Hi there,
I am working on a form that uses 3 text boxes and 3 combo boxes.
When any data is entered into any of these, I click a command button
and this requeries a sub query in the form and displays data dependent
on what has been typed in.
After having trouble with populating my second combo box (I eventually
populated it by putting the fields for both combo boxes in 1 separate
query) I am now having problems with the 3rd one and am literally
tearing my hair out!!
I have set it up exactly the same as the others. This is in the 'Row
Source' row:
SELECT DISTINCT [Dept Combo Query].Attending or Facilitating FROM [Dept

Combo Query];

I have a Query called 'Dept Combo Query' which contains 2 fields - one
for each of the other combo boxes - and then a 3rd field called
'Attending or Facilitating'.
The query has no criteria at all in it.
When I run my form and click the 3rd combo box I get a prompt coming up

asking for 'Parameter Value'. If I am correct, I believe this should
only be displayed if you have criteria in the query? If I click
'Cancel' then I can use the combo box as normal but there are no values

displayed.
I have tried moving the field to a query all by itself and it still
prompts for the Parameter Value.
Any ideas on how I can stop this popup and populate the combo box??
Any help is gratefully recieved!
R.
 
V

visionstate

Hi again,
After 4 hours of trying I've managed to solve this!
It didn't like the fact that the field was called 'Attending or
Facilitating'. I changed the field name in the table to 'Attending' and
it worked.
So simple yet so frustrating!!

R.
 
G

Guest

Hi -- Any time you have a table, query, report, or field name with spaces you
need to include brackets around the name when referencing it in code:
[Attending or
Facilitating]

Also, I recommend looking up standard naming conventions as this will assist
you as your DBs and code become more complex.
 
B

BruceM

I believe that when the field contains spaces, the field name needs to be
within brackets:
SELECT DISTINCT [Dept Combo Query].[Attending or Facilitating] FROM ...

It is a good idea to avoid spaces in any names. If a space is needed, fill
it with an underscore. It will save you from some headaches. The third
commandment at the MVP site addresses this:
http://www.mvps.org/access/tencommandments.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top