?
Solved

SQL Append looking for end of statment

Posted on 2011-03-24
4
Medium Priority
?
393 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

764 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