A
alex
Reference Variable in multiple Subs
Hello,
I’m trying to accomplish the following:
Sub WriteQuery()
Dim strSQL as String
strSQL = _
“Select * from myTable”
End Sub
Sub RunQuery()
Docmd.RunSQL(strSQL) ‘won’t run because variable not defined in
immediate sub
End Sub
It’s a simplified example, but I’m trying to reference a variable
(that’s set in one sub) in another sub…can I do this in some manner?
Thanks,
alex
Hello,
I’m trying to accomplish the following:
Sub WriteQuery()
Dim strSQL as String
strSQL = _
“Select * from myTable”
End Sub
Sub RunQuery()
Docmd.RunSQL(strSQL) ‘won’t run because variable not defined in
immediate sub
End Sub
It’s a simplified example, but I’m trying to reference a variable
(that’s set in one sub) in another sub…can I do this in some manner?
Thanks,
alex