I'm using the following code to try and get an unbound combo to filter a split form:
The immediate window shows the following:
This gives me a runtime error 3075.
If I change the code to this:
The immediate window shows this:
This gives a runtime error of 3464.
If I manually copy and paste the contents into the column's "Text Filters Equals..." the filter works fine. I have also attempted DoCmd.ApplyFilter but to no success. Even if I could get a macro to copy filterCombo.value and paste it in [Course Name] "Text Filters Equals..." I would be happy.
Any help is appreciated.
Code:
Private Sub filterCombo_AfterUpdate()
Me.FilterOn = False
Dim strFilter As String
strFilter = Me.filterCombo.Value
Debug.Print Me.filterCombo
Debug.Print Me.FilterOn, "[Course Name] = " & strFilter & ""
Me.Filter = "[Course Name] = " & strFilter & ""
'DoCmd.ApplyFilter , "[Course Name]='strFilter'"
Me.FilterOn = True
End Sub
The immediate window shows the following:
Code:
Year - SUPPLIER - Course Name
False[Course Name] = Year - SUPPLIER - Course Name
This gives me a runtime error 3075.
If I change the code to this:
Code:
Debug.Print Me.filterCombo
Debug.Print Me.FilterOn, "[Course Name] = '" & strFilter & "'"
Me.Filter = "[Course Name] = '" & strFilter & "'"
Code:
Year - SUPPLIER - Course Name
True[Course Name] = 'Year - SUPPLIER - Course Name'
This gives a runtime error of 3464.
If I manually copy and paste the contents into the column's "Text Filters Equals..." the filter works fine. I have also attempted DoCmd.ApplyFilter but to no success. Even if I could get a macro to copy filterCombo.value and paste it in [Course Name] "Text Filters Equals..." I would be happy.
Any help is appreciated.