Checkbox doesn't work when true

steve1111

Registered User.
Local time
Today, 08:36
Joined
Jul 9, 2013
Messages
170
Hello,

I have a query that uses a checkbox from a form as a criteria. in the table the values are stored as 0,-1. if i run the query with the checkbox false, the query works and filters correctly, same if the box is null. But when I check the box true, no records load. It worked in an older version of my database so i am not sure why when i copied it over it doesn't work. I even tried a combo box with values of 0, -1 and got the same results.....

thanks
 
How about showing the code involved?
 
SELECT DISTINCT dbo_Drivers.Name, dbo_Drivers.isActive, dbo_Drivers.DriverID AS Pin, pvqryZoneAssignments.Division, pvqryZoneAssignments.[Transporation Coordinator], pvqryZoneAssignments.[Transporation Supervisor], dbo_Zones.Note AS [Zone]
FROM (dbo_Drivers INNER JOIN pvqryZoneAssignments ON dbo_Drivers.DefaultZoneID = pvqryZoneAssignments.ZoneID) INNER JOIN dbo_Zones ON pvqryZoneAssignments.ZoneID = dbo_Zones.ID
WHERE (((dbo_Drivers.isActive)=[Forms]![frmMain]![subaAssets].[Form]![snavStaff].[Form]![subnDrivers]![optActive] Or [Forms]![frmMain]![subaAssets].[Form]![snavStaff].[Form]![subnDrivers]![optActive] Is Null));
 
Add the parameters in the Parameters list in the query and set them to the appropriate data types.
 
I actually have 5 optional criteria on that form, but the checkbox is the only one that is not working when true. I have never had to enter anything into a parameter box in the past, so when i add it now, it is giving me an error if i try and add a Or Is Null statement.
 

Users who are viewing this thread

Back
Top Bottom