GaryInMilwaukee
New member
- Local time
- Today, 07:14
- Joined
- Jul 23, 2010
- Messages
- 5
I know this is a basic question but I cannot get anywhere with it:
I'm trying to use a defined variable in a docmd.sql statement, but when I run it I get no results:
Here is the code:
Private Sub Command22_Click()
Dim varX As Variant
varX = "Brandi"
DoCmd.RunSQL "SELECT Items.Owner INTO temp " & _
"FROM Items " & _
"WHERE (((Items.Owner)= '$varX'));"
End Sub
It runs but with no results. I can't get the varX variable to work in then docmd.sql statement...Help!
I'm trying to use a defined variable in a docmd.sql statement, but when I run it I get no results:
Here is the code:
Private Sub Command22_Click()
Dim varX As Variant
varX = "Brandi"
DoCmd.RunSQL "SELECT Items.Owner INTO temp " & _
"FROM Items " & _
"WHERE (((Items.Owner)= '$varX'));"
End Sub
It runs but with no results. I can't get the varX variable to work in then docmd.sql statement...Help!