Results 1 to 3 of 3
  1. #1
    U5113499 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    2

    Run time error 3075 syntax error (missing operator) in query expression [LPA_INFORMATION].[LPA_No] =

    Private Sub update_Click()
    Dim db As DAO.Database
    Dim msql As String
    msql = " UPDATE [LPA_INFORMATION] SET [LPA_INFORMATION].[LPA_Location] ='" & Text48 & "', [LPA_INFORMATION].[LPA_OrgUnit] ='" & Text50 & "', [LPA_INFORMATION].[LPA_Office] = '" & Text52 & "', [LPA_INFORMATION].[LPA_Names] = '" & Text54 & "', [LPA_INFORMATION].[LPA_Titles] ='" & Text56 & "', [LPA_INFORMATION].[LPA_Email] ='" & Text58 & "' where [LPA_INFORMATION].[LPA_No] = & Text46 & "
    DoCmd.RunSQL (msql)
    End Sub
    how to fix this

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    At the very end of your string you need to explain to SQL that Text46 represents text (if it does). You have...
    ].[LPA_No] = & Text46 & "

    So maybe
    ].[LPA_No] = '" & Text46 & "'"

    Also, try adding a Debug.print line so you can see your variables concatenated as literal values. Use keyboard shortcut Ctrl+G to view the result in the immediate window.

    Debug.print msql
    'DoCmd.RunSQL (msql)
    End Sub

  3. #3
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    If LPA_No is numeric, your last line is wrong - the closing quote is in the wrong place.

    Try this: [LPA_INFORMATION].[LPA_No] = " & Text46

    john

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

Similar Threads

  1. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  2. Replies: 4
    Last Post: 07-25-2012, 04:01 AM
  3. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  4. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  5. Syntax error missing operator(3075)
    By parisienne in forum Programming
    Replies: 1
    Last Post: 04-07-2011, 02:29 PM

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