Results 1 to 3 of 3

Thread: Simple SELECT statement problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    29
    Set mRS = mCN.Execute("UPDATE Dies SET Die_Notes = '" & Note & "'" Where Tool_No = " & DieSelected)

    Note is a string variable already declared and holds a note from an inputbox.

    Dies is a table in Access 97
    Die_Notes, Tool_No are fields in Access
    DieSelected is the position in the datagrid


    The problem is I get an Object missing error because I am not assigning the string variable Note properly. How do I add in Die_Notes = Note in to the select statement properly?

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Lightbulb

    Set mRS = mCN.Execute("UPDATE Dies SET Die_Notes = '" & Note & "'" Where Tool_No = " & DieSelected)
    If the Tool_No Field DataType is Integer then you should do it like this:
    Code:
    Dim lngRecordAffected as long
    mCN.Execute "UPDATE Dies SET Die_Notes = '" & Note & "' Where Tool_No =" & DieSelected & ";", lngRecordAffected, adExecuteNoRecords
    If the Tool_No Field DataType is String then you should do it like this:
    Code:
    Dim lngRecordAffected as long
    mCN.Execute "UPDATE Dies SET Die_Notes = '" & Note & "' Where Tool_No ='" & DieSelected & "';", lngRecordAffected, adExecuteNoRecords

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    29
    Thanks for your help Chris, much appreciated

Posting Permissions

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



Click Here to Expand Forum to Full Width