Keith Nichols
Registered User.
- Local time
- Tomorrow, 00:17
- Joined
- Jan 27, 2006
- Messages
- 431
I want to use SQL to populate a variable that is used elsewhere in my code. none of the various methods I have tried work so I was wondering if this is possible in the first place and if it is, what is the syntax/structure of the code?
Code:
Dim DeptOrder As String
DeptOrder.DoCmd.RunSQL SQLText & WClause [COLOR="Green"] 'this gives invalid qualifier error[/COLOR]
DeptOrder = DoCmd.RunSQL SQLText & WClause [COLOR="green"] 'this gives syntax error[/COLOR]
DoCmd.RunSQL SQLText & WClause [COLOR="green"]'this doesn't produce any errors, but where does the query result go to?[/COLOR]