I have a subform and I want to filter it by location.
In the header of the subform I have a dropdown that contains all the possible locations.
I then have a button with the following code :
When I press the button I have a parameter box that appears and asks has the name of the location I selected above the input area. If I enter the name again, it works.
I.e. Select Brighton, click Button, Parameter box appears with the workd "Brighton" in it, if i type brighton into the box the filter works as expected.
I've checked and re-checked my spelling.
When I pause the code I get :
Me.Filter = "Location =Brighton" (for example)
The form filters just fine if I right click in the location field and select "Equals Brighton"
This is driving me bonkers
In the header of the subform I have a dropdown that contains all the possible locations.
I then have a button with the following code :
Code:
Private Sub FilterLocBut_Click()
Dim Filtertown As String
Filtertown = "Location =" & Me.LocationCBO.Column(1)
Me.Filter = Filtertown
Me.FilterOn = True
End Sub
When I press the button I have a parameter box that appears and asks has the name of the location I selected above the input area. If I enter the name again, it works.
I.e. Select Brighton, click Button, Parameter box appears with the workd "Brighton" in it, if i type brighton into the box the filter works as expected.
I've checked and re-checked my spelling.
When I pause the code I get :
Me.Filter = "Location =Brighton" (for example)
The form filters just fine if I right click in the location field and select "Equals Brighton"
This is driving me bonkers