Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    2

    Unhappy Unanswered: runtime error 3075

    Hi everyone,

    Just a quick error question. I keep getting a runtime error 3075. syntax error operator missing.
    I have absolutely no idea what Ive done wrong and Ive asked a few friends and even they cant figure it out.
    Coding is not my forte so just wondering if anyone can tell me what ive done wrong here. Your help would be greatly appreciated

    ive highlighted the section that the debug option is highlighting but cant figure out what mistake ive made.

    many thanks for your time guys x

    -------------------------------------------------------------

    Option Compare Database

    Private Sub Staff_List_AfterUpdate()


    Me.M_LN = Staff_List.Column(1)
    Me.M_FN = Staff_List.Column(2)
    Me.M_Loc = Staff_List.Column(3)
    Me.M_QT = Staff_List.Column(4)
    Me.M_QD = Staff_List.Column(5)


    Me.N_Loc = Staff_List.Column(3)
    Me.N_QT = Staff_List.Column(4)
    Me.N_QD = Staff_List.Column(5)

    Me.Historical.Requery
    End Sub



    Private Sub Update_Me_Click()

    If IsNull(Me.Staff_List) = True Then MsgBox "Please select a staff member", vbOKOnly + vbInformation, "No selection": Exit Sub

    DoCmd.SetWarnings False

    strSql = "INSERT INTO staff_b ( [key], Location, Qualification_Type, Qualification_Discipline , [Date] )"
    strSql = strSql & " SELECT " & Me.Staff_List & " AS [Key],"
    strSql = strSql & " " & Me.M_Loc & " AS S1,"
    strSql = strSql & " " & Me.M_QT & " AS S2,"
    strSql = strSql & " " & Me.M_QD & " AS S3,"
    strSql = strSql & " Now() AS [When];"

    DoCmd. RunSQL strSql



    strSql = "UPDATE staff_a "
    strSql = strSql & " SET staff_a.Location = " & "Me.N_Loc" & ", "
    strSql = strSql & " staff_a.Qualification_Type = " & "Me.N_QT" & ","
    strSql = strSql & " staff_a.Qualification_Discipline = " & "Me.N_QD" & ""
    strSql = strSql & " WHERE (((staff_a.key)=" & Me.Staff_List & "));"



    DoCmd. RunSQL strSql

    Me.Staff_List.Requery

    DoCmd.SetWarnings True

    Staff_List_AfterUpdate
    End Sub

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    This should help:

    Debugging

    Offhand, you don't have a FROM clause. You may want to switch to the VALUES syntax, which is more appropriate to what you're doing:

    INSERT INTO TableName(Field1, Field2)
    VALUES(Value1, Value2)
    Paul

Tags for this Thread

Posting Permissions

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