Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Simple code ? (Access 97)

    I need help creating a string in the SQL statement below. This code is not all the code just a sample. So your not seeing the whole picture. Basically what I want to do is have a string replace where it says ImportTempGRE. ImportTempGRE is the name of the table the SQL is accessing. I would like to replace the table name with a string. Is this possible in the current context? If not how can I re-write this to refect the same thing? Thanks for the help..


    Dim strSQL As String
    Dim ImportTemp as String

    ImportTemp = "ImportTemp" & Program

    strSQL = "DELETE IssuedTo.* " & _
    "FROM IssuedTo INNER JOIN ImportTempGRE " & _
    "ON IssuedTo.[Voucher#] = ImportTempGRE.[Voucher#];"

  2. #2
    Star Lounger
    Join Date
    Nov 2001
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Simple code ? (Access 97)

    A little punchy tonight but I think this is what you are after:

    Dim strSQL As String
    Dim ImportTemp as String
    Dim mportTempGRE As String

    ImportTempGRE = "MyTableName"
    ImportTemp = "ImportTemp" & Program

    strSQL = "DELETE IssuedTo.* " & _
    "FROM IssuedTo INNER JOIN " & ImportTempGRE & " & _
    "ON IssuedTo.[Voucher#] = " & ImportTempGRE & ".[Voucher#];"

    hth,
    Jack

Posting Permissions

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