Since merging a filter string is an ongoing issue, I was about to give the tip to use BuildCriteria, as this will create a correct filter expression.
Example:
Code:
Dim FilterValue As String
Dim FilterString As String
FilterValue = "AB123456"
FilterString = BuildCriteria("[Student ID]", DataTypeEnum.dbText, FilterValue)
Debug.Print FilterString
This fits in principle, unless you include " in the string.
=> [Student ID]="abc"xyz"
I use my own method, so I have too little practice with the built-in BuildCriteria.
But I would have expected Access.BuildCriteria to at least double the ".