Insert string value in a field with where condition.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • usha2
    New Member
    • Mar 2012
    • 23

    Insert string value in a field with where condition.

    Sir,
    I have some value in my main table:All_Table
    A columh(Net_Logi n) with value:"xyz"
    I have a string:strValue

    I want to insert/update(which will work fine?)my table"All_table ",strvalue where xyz found.

    What i tried and saya error msg'Semicolon (;) missing '
    Code is:
    Code:
    strUpdateTbl = "INSERT INTO All_Table
    (Net_Login) VALUES (" & strvalue & ") " & _
                        " WHERE ([All_Table].[Net_login])='xyz'"
            cnnProject.Execute (strUpdateTbl)
    Please rectify my error.
  • limweizhong
    New Member
    • Dec 2006
    • 62

    #2
    The SQL clause "insert into" is for an append query. Use the "update" clause instead. Why don't you create a simple update query in the query design view first, and then switch to SQL view to see how the "update" clause is written?

    Comment

    Working...