B
Bob Quintal
I've created a field in two different tables called
"GroupCode". It's defined as a number, field length byte.
In my Labor DB, I set the field to a value of 1.
In my Inventory DB, I set the field to a value of 2.
If it's used in both DBs, I set the field a value of 3 (1+2).
It's a binary "dip switch".
Now, when I start up my Labor DB, I set up a global variable
called glbModuleID with a 1 or a 2. That variable is defined
as a "byte" type, and it's global.
I want the RowSource of a selection box to include only rows
where the GroupCode is set to be valid for this Module (Labor,
Inventory....) So, the record is valid for Labor if the
GroupCode is 1 or 3 (the least signficant bit is set.)
I can't seem to set up the query so this works. I've been
using a where clause that says "where ((GroupCode AND
glbModuleID) = true)". This doesn't work. First, it doesn't
see glbModuleID for some reason, and second, when I force the
issue, it always returns "true" and selects the row.
What's wrong with my logic/syntax?
Use "where ((GroupCode AND glbModuleID) = glbModuleID)"