Solved

SQL Append looking for end of statment

Posted on 2011-03-24
4
383 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
  • 3
4 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
query question 12 34
MS SQL Conditional WHERE clause 3 38
Query - Duplicate dates with different activities counts 10 45
Syntax error creating JSON recordset 4 27
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

749 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