Distinguish between ‘Active’ and ‘Inactive’ Records

schu7044

Registered User.
Local time
Today, 16:39
Joined
Jan 31, 2008
Messages
14
I am using a form and subform for user input. I have set the recordsource for the subform using VBA. This recordsource is based on user input entered via a combobox.

The following code works very nicely to set the recordsource:

Forms!frmCiaGroups1.frmCiaGroupsSub.Form.RecordSource = "SELECT * FROM qryCIAGroupActive WHERE Left([TxGroup],3) = " & strGroup

The code is selecting all records where the left 3 characters match the left 3 characters in the combobox (which is the group number, i.e. T02, W05, etc.

Now I want to enhance the code to distinguish between ‘active’ and ‘inactive’ records. The subform contains a yes/no checkbox named “ActiveInGroup”

It seems like a simple AND statement would work but I’m confused about the syntax.

I am hoping someone can help me out with this.

Thank you, Don
 
"SELECT * FROM qryCIAGroupActive WHERE Left([TxGroup],3) = " & strGroup & " AND FieldName = True"

Or false, as appropriate.
 

Users who are viewing this thread

Back
Top Bottom