Benginner2212
Member
- Local time
- Yesterday, 17:57
- Joined
- Apr 6, 2023
- Messages
- 52
I am trying to filter forms based on the value of two check boxes. I have a check box called activeEquipment on a form that I am using to track if a piece of equipment is being actively used. The value of the box is True if the Piece of Equipment is being used and false when the equipment has been moved to storage. I have a second check box on the form named disposedEquipment that I am using to track if a piece of equipment has been removed from storage and thrown away.
I would like to open a set of forms where equipment that has been moved to storage or thrown away are filtered out. So far I have been able to figure out how to filter out either the equipment that has been moved to storage or the equipment that has been throw away but when I try to filter our both at the same time I get a data type mismatch error.
Here is my code:
when I look at the Debug.Print I can see that the criteria that I am checking for is correct, but I can't figure out the data mismatch error
Any help would be greatly appreciated
I would like to open a set of forms where equipment that has been moved to storage or thrown away are filtered out. So far I have been able to figure out how to filter out either the equipment that has been moved to storage or the equipment that has been throw away but when I try to filter our both at the same time I get a data type mismatch error.
Here is my code:
Code:
Private Sub btnEquipmentTracking_Click()
Dim activeEquipment As String
Dim disposedEquipment As String
activeEquipment = "True"
disposedEquipment = "False"
Dim trackingCriteria
trackingCriteria = "activeEquipment=" & activeEquipment & " AND disposedEquipment='" & disposedEquipment & "'"
DoCmd.OpenForm "frmEquipTrack", acNormal, , trackingCriteria, , , "NewEquipment"
Debug.Print "tracking Criteria "; trackingCriteria
End Sub
when I look at the Debug.Print I can see that the criteria that I am checking for is correct, but I can't figure out the data mismatch error
Any help would be greatly appreciated