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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting Var into SQL

Status
Not open for further replies.

Zeroanarchy

Technical User
Jun 11, 2001
630
AU
Hi all,

I have tried different variation of this but I can not seem to get it to work.

Code:
Var t_name
t_name = tablename & Date

'DoCmd.RunSQL "CREATE TABLE t_name ([Product Code] TEXT, [Product Name] TEXT, [Cost] CURRENCY);"

Thanks for your help in advance.


[afro]ZeroAnarchy
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.

 
Perhaps this ?
DoCmd.RunSQL "CREATE TABLE [!][" & [/!]t_name [!]& "][/!] ([Product Code] TEXT, [Product Name] TEXT, [Cost] CURRENCY);"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
THanks PHV for your help, worked great.

[afro]ZeroAnarchy
Experience is a wonderful thing. It enables you to recognize a mistake
when you make it again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top