I have a subform that I want to filter using a combobox.
The subform query is in the left side of the photo that I have attached and the result that supposed to show up on the subform when I clicked on the combobox is on the right side (in red box).
The problem is I couldn't get the subform to show up like that.
I am not good with logic so I can't comprehend how to make the subform appears like that.
When I choose Texas, it also shows the Billing No. for 103 and 104 but I don't want that. I just want it to show Billing No. 106.
Below is the code that I use:
Private Sub cboLocation_AfterUpdate()
If Not IsNull(cboLocation.value) Then
subDuty.Form.FilterOn = True
subDuty.Form.Filter = " [StandardWorkLoc] = " & cboLocation.value & " OR [DeviantWorkLoc] = " & cboLocation &" "
subDuty.Form.FilterOn = False
I also tried using the following codes, but the result will only show the records in Standard Work Location.
subDuty.Form.Filter = "IIf(IsNull([DeviantWorkLoc]), [StandardWorkLoc], [DeviantWorkLoc]) = " & cboLocation
Where did I do wrong here?