Results 1 to 4 of 4
  1. #1
    AAAndy is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2016
    Posts
    68

    Update Query error = Data type mismatch in criteria expression

    What is wrong with the below. I have been trying to figure this out for like 2 hours now.

    Update Query error = Run-time error '3464': Data type mismatch in criteria expression




    Code:
    
        sSQL = "UPDATE dbo_tbl_Custom_Subscription_Subscriptions"
        sSQL = sSQL & " SET [varExtensionSettingValueList] = '" & LStringEmail & "' WHERE [intSubscriptionID] = '" & Me.txtintSubID.Value & "';"
        Debug.Print sSQL
       
        CurrentDb.Execute sSQL, dbFailOnError

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    it means youre trying to put a string in the number field.
    remove the quotes from the ID.
    sSQL = sSQL & " SET [varExtensionSettingValueList] = '" & LStringEmail & "' WHERE [intSubscriptionID] = " & Me.txtintSubID.Value

  3. #3
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Is the intSubscription field text or numeric?
    If it is numeric, you do not need the quotes around it, i.e.
    Code:
    WHERE [intSubscriptionID] = " & Me.txtintSubID.Value & ";"

  4. #4
    AAAndy is offline Advanced Beginner
    Windows 7 64bit Access 2013 32bit
    Join Date
    Aug 2016
    Posts
    68
    That is fixed now. thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-21-2016, 09:43 PM
  2. Replies: 2
    Last Post: 08-24-2015, 09:14 PM
  3. Replies: 3
    Last Post: 07-21-2014, 09:33 AM
  4. Replies: 1
    Last Post: 05-02-2013, 01:29 AM
  5. Replies: 1
    Last Post: 05-11-2012, 10:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums