Docmd.RunSQL Update is giving back an an error 3464

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tim20002
    New Member
    • Apr 2015
    • 1

    Docmd.RunSQL Update is giving back an an error 3464

    hi I'm having some trouble running this sql and I get an error #3464 Data type mismatch in criteria expression.

    What I'm trying to do is update [tbl_Account]![Available] a Yes/No field to Yes in my after I assign it.
    Code:
    Dim strSQLb As Variant
    strSQLb = DLookup("[ACCOUNT]", "qry_Avail_ACCOUNTS")
    DoCmd.RunSQL "Update tbl_ACCOUNTS SET tbl_ACCOUNTS.Used= Yes  where tbl_ACCOUNTS.ACCOUNT=" & strSQLb
    and I've tried this;
    Code:
    DoCmd.RunSQL "Update tbl_FIR_ACCT SET tbl_FIR_ACCT.Used= '" & Yes & "' where tbl_FIR_ACCT.FIR_ACCT=" & strSQLb
    to no avail.. any help would be much appreciated.
    Last edited by NeoPa; Apr 10 '15, 12:42 AM. Reason: Please remember that you must you [CODE] tags when posting code.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32656

    #2
    If the [Account] field is not numeric then you need the single-quotes around that value. Certainly not around the Yes.
    Code:
    DoCmd.RunSQL "UPDATE [tbl_ACCOUNTS] SET [Used]=True WHERE ([ACCOUNT]='" & strSQLb & "')"

    Comment

    Working...