If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > runtime error 3075

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-03-12, 19:54
HKitten<3 HKitten<3 is offline
Registered User
 
Join Date: Jan 2012
Posts: 2
Unhappy 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
Reply With Quote
  #2 (permalink)  
Old 01-03-12, 19:58
pbaldy pbaldy is offline
Registered User
 
Join Date: May 2005
Location: Nevada, USA
Posts: 2,475
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
Reply With Quote
Reply

Tags
3075, error, help needed, sql, visual basic

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On