I have a combobox that provides a drop down list of users based on the following SQL:
SELECT [child surname] & ", " & [child forename] AS [Child Name], tblChildData.childID, tblChildData.[child surname], tblChildData.[child forename], tblChildData.Active
FROM tblChildData
WHERE (((tblChildData.Active)=True))
ORDER BY tblChildData.[child surname], tblChildData.[child forename];
The list is dependent on the actual record being active (a field in the data table called ACTIVE). However, I want to be able to give users the ability to decide whether they just want to view users whose records are active, or all records in the table. I have an optionbox on the form the combobox is on, the default value being 1 for active records, but I can't get the syntax right in the combobox SQL for choosing the alternative (all records) when the value of the optionbox becomes 2.
Can anyone help, please, as this is driving me mad!?
Many thanks
John R
SELECT [child surname] & ", " & [child forename] AS [Child Name], tblChildData.childID, tblChildData.[child surname], tblChildData.[child forename], tblChildData.Active
FROM tblChildData
WHERE (((tblChildData.Active)=True))
ORDER BY tblChildData.[child surname], tblChildData.[child forename];
The list is dependent on the actual record being active (a field in the data table called ACTIVE). However, I want to be able to give users the ability to decide whether they just want to view users whose records are active, or all records in the table. I have an optionbox on the form the combobox is on, the default value being 1 for active records, but I can't get the syntax right in the combobox SQL for choosing the alternative (all records) when the value of the optionbox becomes 2.
Can anyone help, please, as this is driving me mad!?
Many thanks
John R