Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable from function in SQL string......

Status
Not open for further replies.

flaniganmj

Technical User
Jun 25, 2002
81
US
This should be easy, but I couldn't find the answer in any of the old threads. I have have a function that is called with x number of variables, some of which are strings. I create an SQL statement string to run in the command:

DoCmd.RunSQL mySQL

The SQL is for an append query, so "INSERT INTO"..."SELECT" blah blah. But when I use the string variable:

myVariable & " AS Exp1, " & _

to build the SQL string, it doesn't recognize the variable string. So:

myVariable AS Exp1,

instead of

"myVaribale" AS Exp1


I've tried using Chr(147) or using (') around each of the variables, with no sucess with either though. Maybe I am approaching this wrong. Any help or suggestions will do.
 
figured it out. thanks to anyone that was looking into it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top