Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    Barnsley, Yorkshire, England
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Variables in SQL statements....

    I'm sure this is possible, but i've tried all the altenatives in terms odf syntax i can think of...

    I create a temporary table which is a copy of a master, but named according to a couple of variables..

    Dim strGPUK As String
    Dim strDate As Date
    Dim strTableName As String

    strGPUK = Me.Selected
    strDate = Date

    strTableName = "tblTempOrder" & "_" & strGPUK & "_" & strDate

    docmd.CopyObject , strTableName, acTable, "tblTempOrderTemplate"


    Now i want to append one record into this table using an INSERT INTO statement, but i can't work out the syntax for the table name....

    I thought it would be something like INSERT INTO "strTempTable" ......

    Thanking you in advance

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Variables in SQL statements....

    Try mySQL = "INSERT INTO " & strTempTable & "....


    Richard Aheron
    raheron@hotmail.com
    Richard

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •