Get criteria from combo box

pholligan

Registered User.
Local time
Today, 21:55
Joined
Jan 20, 2003
Messages
19
Hi

I am trying to get a query to call a combo box for it's criteria, but I can't seem to get it to work! Any ideas?

I have a database with a load of records and I want to select only records for a specific person. I have it working with [Type Surname] but would like a list of all surnames to select from for ease of use.

Any help would be greatly appreciated.

Paul
 
The criteria is

Forms!FormName!ComboBoxName


Col
:cool:
 
Thanks for your hepl again Col.

I must be doing something stupid as I've tried this time and time again but when I run the Query a pop up box appears which says "[Forms]![SurnameSelect]![combo4]", rather than showing the Form required!

Where am I going wrong?!!!!!

Paul
 
Don't put it in quotes " " and don't use square brackets []

Col
 
Sorry for the confusion.....I didn't put it in quotes, and it put the square brackets in itself!
 
Right....I see the first problem!

I need the form open when I run the query, I was expecting the query to open the form!

Now the query runs but doesn't seem to produce anything no matter what I select in the combo box!
 
Yes thats right - personally I like Access to do the square brackets itself. I have had it where it got a bit confused when I did it myself.

I can't think whats wrong - I've double checked on my queries that use it and all seems fine.

Can you post any sample Db that may help?

Col
 
You know the saying 'It never rains but it pours'! Well that's what my day has been like!

I've been trying to attach a copy of the database for the past 30 minutes and I can't get the file small enough. I've zipped it, which got it to 132kB, then tried deleting lots of reports and queries that are not needed but this didn't reduce the file size at all! I then tried copying tables etc into another database, problems there too!

Can I email you the database personally?

Sorry to cause so much hastle over such a trivial task!

Thanks again
Paul
 
I have now worked out why it wasn't working! I needed .Text after eg. [Forms]![FormName]![Combo6].Text

Thanks for all your help Col. I'm sure it will be needed again in the not too distant future!

Paul
 
i was really thankful that this thread has been posted coz i also encountered this kind of problem. but i wonder why the final criteria expression:

[Forms]![FormName]![combo6].text

wont work on mine.

does it have to do with the type of action query? i'm using an append.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom