parameter query

bladedfeather

Registered User.
Local time
Today, 02:50
Joined
May 25, 2011
Messages
10
I want to create a parameter query on the table i made. The fields on the table that i want to create a parameter is a lookup table (tblLeaveType), this lookup table has two fields one is the primary key(auto number) and the other is the type of the Leave

example
1. Annual Leave
2. National Holiday
3. Professional Leave
4. Eid Al Fetr

my question is how can i create a parameter query? when i put "national holiday" on the criteria in the query of the fields LeaveTypeID and run the query there is a message like this.. Data type mismatch in the criteria expression.

Hope somebody could help me.. thanks..:)
 
If leave type ID is a number type, and you are entering "national holiday", a text type, you will recieve this error. Instead of using quotes, use a bracket, ie, [national holiday]. This way when the query is run, it will ask you for the leavetypeID. All you will need to do is enter the number that corresponds with "national holiday". There are a few ways of supplying this parameter with the value desired, but that depends on your needs.
 
If leave type ID is a number type, and you are entering "national holiday", a text type, you will recieve this error. Instead of using quotes, use a bracket, ie, [national holiday]. This way when the query is run, it will ask you for the leavetypeID. All you will need to do is enter the number that corresponds with "national holiday". There are a few ways of supplying this parameter with the value desired, but that depends on your needs.


thanks speakers_86 for your reply. if i wanted to show only two specific Leave Type on my parameter query i cannot do it if i will use the bracket. Like if i will put on the criteria "National Holiday" and or "Annual Leave". Is there any way i can do this? thanks again..
 
So you are trying to provide two different criteria? Try [Criteria1] or [Criteria2]. When you run the query, provide the numbers that correlate with "national holiday" and "annual leave". If this doesn't answer your question, can you post your database?
 
So you are trying to provide two different criteria? Try [Criteria1] or [Criteria2]. When you run the query, provide the numbers that correlate with "national holiday" and "annual leave". If this doesn't answer your question, can you post your database?

thank you speakers_86 its solves my problem. :):)
 

Users who are viewing this thread

Back
Top Bottom