First off, I'm a novice at Access and VBA. I have some VBA experience, but it's sporadic.
I am making a form in an existing database. I'm trying to filter a query in the sub form using a combo box (combo61) The name of the field I'm trying to filter is Reference Number. I'm trying to use the code below:
Code:
Private Sub Combo61_AfterUpdate()
Me.Filter = "Reference Number" & Me.Combo61
DoCmd.RunCommand acCmdApplyFilterSort
End Sub
When I run the code I get: Run-time error 3075
Syntax error (missing operator) in query 'reference number 11-01-03-01'.
11-01-03-01 is the value I'm trying to filter for in "Reference Number".
What am I doing wrong? Any help would be greatly appreciated.