Is this a criteria bug?!

Les Isaacs

Registered User.
Local time
Today, 14:48
Joined
May 6, 2008
Messages
186
Hi All
I thought I knew about criteria, but cannot for the life of me get this to work - should be simple, but no joy - so I suspect it's a Gates Gaff :eek:

The criteria I have is:
IIf([Forms]![frmAthletesRegistration]![optSex]=1,"M",IIf([Forms]![frmAthletesRegistration]![optSex]=2,"F","M" Or "F"))

So:
If [Forms]![frmAthletesRegistration]![optSex]=1, I want the males,
If [Forms]![frmAthletesRegistration]![optSex]=2, I want the females,
If [Forms]![frmAthletesRegistration]![optSex]=3, I want the males and females.

This works fine where [Forms]![frmAthletesRegistration]![optSex]=1 or 2, but when [Forms]![frmAthletesRegistration]![optSex]=3 the query returns no records :mad:
I've tried all sorts:
IIf([Forms]![frmAthletesRegistration]![optSex]=1,"M",IIf([Forms]![frmAthletesRegistration]![optSex]=2,"F",Like "*"))
or
IIf([Forms]![frmAthletesRegistration]![optSex]=1,"M",IIf([Forms]![frmAthletesRegistration]![optSex]=2,"F",Like "?"))
or
IIf([Forms]![frmAthletesRegistration]![optSex]=1,"M",IIf([Forms]![frmAthletesRegistration]![optSex]=2,"F",>"A"))
but none of these return any records :banghead:

Is it me, or Gates?
Thanks for any help.
Les
 
OK - this is getting weirder - straight after posting the above it occurred to me to check the value of [Forms]![frmAthletesRegistration]![optSex] when I am expecting it to be 3, so I removed the criteria that's causing no records to be returned, and when I run the query in the [Forms]![frmAthletesRegistration]![optSex] field, where I expect to see 3, I see a small capital L :eek:

[Forms]![frmAthletesRegistration]![optSex] is an option group that is only ever 1, 2 or 3. For the current case, it is assigned to 3 immediately before running this particular query. So why does the query show a small capital L :confused:

Even more strangely, I just created a new form, added a text field, set its control source to =[Forms]![frmAthletesRegistration]![optSex], and opened the form: the text field showed a 3 :(

Running out of funny faces here: what's going on?
Hope someone can enlighten me.
Thanks in advance
Les
 
A feature - so that's what you call it!
Thanks for the tip.
Les
 

Users who are viewing this thread

Back
Top Bottom