Criteria for drop-downs

AuroX7

Registered User.
Local time
Yesterday, 16:21
Joined
Feb 22, 2006
Messages
44
In my query I want to find the total number of "occasional" bookings.
There are two types: occasional and regular.
However, when I select the tblBooking and the field it finds the total number of all the bookings, which is 10 (5 reg. and 5 occ.). However, I only want to find the occasional (5) and not regular. The field is a drop-down (lookup wizard) so when I type "occasional" into the criteria it says a data mismatch. I've used the 'Count' function, but it still says data mismatch. So basically, I want to count the number of occasional bookings but it's from a drop-down field. It will find the total number (10) of both types of booking, but I only want to find the occasional. How do I do this?
Also, how would I calculate the percentage? I want to find the percentages of both the occasional (50%) and regular (50%) bookings. I don't mean to waffle on. Thank you for your time. :)
 
In your query did you group by the bookings? Why don't you make booking a text data type?
 
I can group by the total number of bookings using Count...which gives me 10. But I want to find the individual number of occasional ad regular. Surely I would need to enter something into criteria? :(
 
You can't do criteria from lookup columns.

The field is a drop-down (lookup wizard) so when I type "occasional" into the criteria it says a data mismatch.

That's because the bound column in your lookup column will turn out to be a numeric column (TypeId or whatever you called it).

What you need to do is to include your bookings and type table in the query, join them over TypeID and add a condition so the query only retrieves rows having type "occasional" in your type table

Do not use lookup columns, however usefulll they may seem:

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=52876

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=52861

RV
 
I changed it to text and used a validation rule "Occasional" Or "Regular" which works fine. When I query it and use the Count function, it finds the total number of bookings which is fine. When I type "Occasional" or "Regulat" into the criteria it says data mismatch expression. What's going on...this is so annoying. -_-
 
Last edited:
I changed it to text and used a validation rule "Occasional" Or "Regular" which works fine.What's going on...this is so annoying

Wrong approach.
You really need to understand that your lookup column causes your problem plus why.
Have you read the threads I referred to?

RV
 

Users who are viewing this thread

Back
Top Bottom