latex88
Registered User.
- Local time
- Today, 17:12
- Joined
- Jul 10, 2003
- Messages
- 198
I don't know what's common practice, but I've been using functions to pass values to queries as criteria. I would often set a global variable from a dlookup function or from a record selected in a form, then I'd pass the value to a query. I'm not sure if this not a good practice or something is wrong with my app. I would often get the error message of "Unknown Access database engine error" when the queries are triggered. What baffles me is that I do not always get that message. Is there a better and stable way to pass values to queries? Below is an idea how I set the variable and passing it to a query.
' This line is declared in a module
Public strOrderID as Integer
'Below may be inside a form when a record is selected
strOrderID = dlookup ("MyOrderID", "MyOrderTable",....)
Public Function OrderID ()
OrderID = strOrderID
End Function