Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL Append looking for end of statment

Posted on 2011-03-24
4
Medium Priority
?
400 Views
Last Modified: 2012-05-11
Dim strSQL As String
    Dim RecordName,tableName As String
    RecordName = Me.rHid  'changed to Rused- name conflict?
    TableName= "table" & me.RN
        strSQL = "INSERT INTO tablename ( rHid, Fps1, Fps2, Fps3, Fps4, Fps5, Fps6, Fps7 )" _
       "SELECT test.rHid, test.Fps1, test.Fps2, test.Fps3, test.Fps4, test.Fps5, test.Fps6, test.Fps7" _
       "FROM test WHERE (((test.rHid)="RecordName"))"

 
    strSQL = "INSERT INTO tableName ( rHid, Fps1, Fps2, Fps3, Fps4, Fps5, Fps6, Fps7 )"
    strSQL = "SELECT test.rHid, test.Fps1, test.Fps2, test.Fps3, test.Fps4, test.Fps5, test.Fps6, test.Fps7"
    strSQL = "FROM test WHERE ((test.rHid) = "Rused"))"
                                                             highlights ^^^^^  
  CurrentDb.Execute strSQL, dbFailOnError
I tried extra ",extra() and spaces and  the two types above
BTY is one better than the other?
0
Comment
Question by:afreer2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 2000 total points
ID: 35211993
did you try single-quotes?

strSQL = "FROM test WHERE test.rHid = 'Rused' "
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 35211998
... and you did have one extra ) in your last statement above, after .rHid
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 35212007
and if you need to use double-quotes, you need to double them up for VBScript:

    strSQL = "FROM test WHERE test.rHid = ""Rused"" "
0
 

Author Comment

by:afreer2
ID: 35212026
Single quote worked
Always can depend on Experts Exchange..
thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question