like Forms![Select birthday]![combo0]

iso96

Registered User.
Local time
Today, 12:28
Joined
Mar 21, 2005
Messages
10
hello,

i am trying to use the above in the exprssion builder but it wont work, In the 'combo0' is a list of months - january, febuary etc and in the table is '04 january'

in a normal SQL statement i would use:

like '*whateverfield*'

and that would do it but because im using an access forms interface i cant manage it

any help would be appreciated


thanks

iso
 
When you use a combo to select a value, you almost certainly don't want to use Like as the comparison operator. You would want to use =.

Where BirthDay = Forms![Select birthday]![combo0]

Like is ONLY used in the rare cases where the user will type in parts of the text he is looking for and you need to use wild cards to tell Jet how to search. ALL other cases would use the = operator. Also, don't forget that Like only works agains TEXT fields. You will find that it doesn't work as you think it will when searching date or numeric fields.
 
Hello Pat

The values in the Combo are months like i said january,febuary etc... but the table contains the day and the month eg 03 january.

how would you suggest i use the combo to select for instance any birthdays in january

when the field

'birthday' contains

03 January, 09 January, 23 January, 30 January

Thanks for your help
 
If the birth date is stored as a real date field, you can't use a string type comparison at all. Dates are stored as serial numbers which are double precision numbers.

If your DOB is a date, the following should work to extract the full text month name from the DOB field:

Format(YourDOB, "mmmm") = Forms!YourForm!YourCombo
 

Users who are viewing this thread

Back
Top Bottom