Crosstab Referencing a Checkbox

PSmit

Registered User.
Local time
Today, 10:34
Joined
Aug 1, 2007
Messages
12
I'm attempting to build a crosstab query that references fields on a form as criteria for my query. I have no problem referencing a combo box as part of my criteria -- the query likes that fine. However, when I attempt to reference a check box (ex. iif(Forms![CheckBox] = true, "A", "B"), I get the following error:

The Microsoft Jet database engine does not recogine '[Forms]![frmMyForm]![Check100]' as a valid field name or expression.

Anyone have any ideas why I can not reference a checkbox but I can other types of fields in my crosstab query?

Thanks in advance!
 
I think you may need to keep in mind the values represented by these two objects and how you're using them.

a Checkbox is true/false;0/-1, on/off.
You can use that to apply a record filter for the crosstab (setting a the criteria as true or false), but I don't think you can use it as part of a IIF to define a column heading for a crosstab.
 
By record filter, do you mean the following?

Put something like "Expr1 : [Forms]![MyForm]![Checkbox]" as a field in the crosstab query with the Criteria set to True?

If so, I've tried that as well and it gives the same error message...

Can you think of anything else that I can try or did I misunderstand your previous post?
 
Never mind... Chalk this one up to having to add in extra features after creating the initial queries a while back (and forgetting what you did in the first place)...

I completly forgot that when you reference things (like a checkbox, combo box, etc.) on a form within your crosstab query, you have to set up the fields as parameters (i.e. when working on the query, go to Query -> Parameters). As the combo box was a part of my original query, I "knew what I was doing" then and had already set it up as a parameter. I was adding in features with the checkbox now, so I hadn't set it up as a parameter (and, of course, the query didn't like me for it).

Anyway, sorry to take up anyone's time! But, at least the post is here if anyone ever has the same issue.
 

Users who are viewing this thread

Back
Top Bottom