carpetbelly
Technical User
I'm having one last bit of problems with my SQL (which should once sorted finish my database w00hoo!)
Is what I have at the moment.
Basically, I have variables I'd rather use for the values in the SQL statements so they're easier to read but I couldnt find how to use them. They'd just keep bringing up parameter boxes for values to be entered into them.
Also, the main issue I have is that I seem to be getting a run time 3075 error on the "DoCmd.RunSQL strSQLHol" where it specifies the following
"forms!frmStaffInput!txtStaffID!,"
syntax error (missing operator) in query expression.
Now, the query run above it works fine. The only thing I can think of is that the setting of the value for StaffID but it's done in order so I don't think it's that.
Any help is much appreciated as my mind is blank. Maybe I shouldn't have had that lunch time drink but hey, it's new years!
Code:
strSQLStaff = "INSERT INTO tblStaff([StaffName], [TeamID], [StaffPayroll]) " & _
"VALUES (forms!frmStaffInput!txtName,forms!frmStaffInput!cmbTeam,forms!frmStaffInput!txtPayroll);"
DoCmd.RunSQL strSQLStaff
StaffID = DLookup("[StaffID]", "qryStaffNameID", "[StaffName] = '" & Name & "'")
txtStaffID.Value = StaffID
strSQLHol = "INSERT INTO tblStaffHolEnt([StaffID], [HolEnt], [CarryFwd], [HolBought]) " & _
"VALUES (forms!frmStaffInput!txtStaffID!,forms!frmStaffInput!txtHolEnt!," & _
"forms!frmStaffInput!txtHolCarFwd!,forms!frmStaffInput!txtHolBought!);"
DoCmd.RunSQL strSQLHol
Is what I have at the moment.
Basically, I have variables I'd rather use for the values in the SQL statements so they're easier to read but I couldnt find how to use them. They'd just keep bringing up parameter boxes for values to be entered into them.
Also, the main issue I have is that I seem to be getting a run time 3075 error on the "DoCmd.RunSQL strSQLHol" where it specifies the following
"forms!frmStaffInput!txtStaffID!,"
syntax error (missing operator) in query expression.
Now, the query run above it works fine. The only thing I can think of is that the setting of the value for StaffID but it's done in order so I don't think it's that.
Any help is much appreciated as my mind is blank. Maybe I shouldn't have had that lunch time drink but hey, it's new years!