I'm having problems using a public variable in the query criteria. I believe I have to code this in SQL view, but not exactly sure of the syntax (something to do with parameters?). I have the variable declared as public in a module. Thanks
You can't use public variables directly in a query. Jet has no way to evaluate them. Create a Public function that returns the variable and then use your function in the query.
Public Function MyVar()
MyVar = PublicVariable
End Function
Then in the query:
Select ...
From YourTable
Where TableField = MyVar();