Results 1 to 3 of 3
  1. #1
    dipitiduda2 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    28

    Access Run-Time Error 3075 - Missing Operator

    Hello All: I cannot figure out the syntax needed for a RunSQL command in Access. I'm getting the error related to the strSQL on a button click event that says "Run-time error 3075 Syntax error (missing operator) in query expression 'abc text abc text'. I just can't figure out what operator is missing or if I'm omitting some single quotes somewhere in the strSQL.

    What I'm trying to do is enter in text for the ChangedProgramName and then click a button on the subform to update the ProgramName value in tbl_ProgramsAdult, then requery the dataset so the combo box has the refreshed information on next load. The code bombs out on the DoCmd.RunSQL strSQL line.

    If anyone can assist I would be grateful. Here's my code:
    Button = cmd_ProgramsAdult_UpdateProgName
    Table to be Updated = tbl_ProgramsAdult
    Text Box where String is Taken From = Me.ChangedProgramName
    PKey in Table to be Updated = tbl_ProgramsAdult.ProgramID
    Text Box where PKey is Found = Me.txtProgramID

    ------------
    Private Sub cmd_ProgramsAdult_UpdateProgName_Click()
    On Error GoTo Err_cmd_ProgramsAdult_UpdateProgName_Click
    strSQL = "UPDATE tbl_ProgramsAdult" & _
    " SET tbl_ProgramsAdult.ProgramName = " & Me.ChangedProgramName & _
    " WHERE tbl_ProgramsAdult.ProgramID = " & Me.txtProgramID

    DoCmd.RunSQL strSQL
    DoCmd.Requery
    DoCmd.Close

    Exit_cmd_ProgramsAdult_UpdateProgName_Click:
    Exit Sub
    Err_cmd_ProgramsAdult_UpdateProgName_Click:
    MsgBox Err.Description
    Resume Exit_cmd_ProgramsAdult_UpdateProgName_Click
    End Sub
    ---------
    Thank you!

  2. #2
    dipitiduda2 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    28
    posting some more information for clarity...

    Here's what is displayed in the Immediate Window when I click the button
    UPDATE tbl_ProgramsAdult SET tbl_ProgramsAdult.ProgramName = abc text abc text WHERE tbl_ProgramsAdult.ProgramID = 1

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    This thread is marked as solved, but if it isn't:

    " SET tbl_ProgramsAdult.ProgramName = '" & Me.ChangedProgramName & "'" & _
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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. Error 3075 Missing Operator
    By KLynch0803 in forum Queries
    Replies: 5
    Last Post: 02-11-2010, 01:13 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