lightkeepr
Registered User.
- Local time
- Today, 01:11
- Joined
- Sep 18, 2012
- Messages
- 15
I have 3 values that are received from a form. They are bulk_add_name, bulk_add_weight and bulk_add_date. what I want to do is add an entry to the table called Payroll that puts bulk_add_name into field SchoolName, bulk_add_weight into ShiftWeight and bulk_add_weight to DateWorked. I also want it to get the value FullName from [Guard Information Query] and pass it into the Payroll table for fields DefaultGuard and WorkingGuard.
So if in [Guard Information Query] there is 20 names listed, 20 new records will be created in table Payroll, one for each name and the values bulk_add_name, bulk_add_weight and bulk_add_date are all added for each record.
Here is what I have been kicking around, where did I go wrong?
CurrentDb.Execute "INSERT INTO Payroll (SchoolName, ShiftWeight, DefaultGuard, WorkingGuard, DateWorked) " & _
"SELECT #" & bulk_add_name & "# AS SchoolName ", #" & bulk_add_weight & "# AS ShiftWeight ", [Guard Information Query].[FullName], [Guard Information Query].[FullName], #" & bulk_add_date & "# AS DateWorked " & _
"FROM [Guard Information Query] " & _
"WHERE (( [Guard Information Query].[Active])=Yes) " & _
So if in [Guard Information Query] there is 20 names listed, 20 new records will be created in table Payroll, one for each name and the values bulk_add_name, bulk_add_weight and bulk_add_date are all added for each record.
Here is what I have been kicking around, where did I go wrong?
CurrentDb.Execute "INSERT INTO Payroll (SchoolName, ShiftWeight, DefaultGuard, WorkingGuard, DateWorked) " & _
"SELECT #" & bulk_add_name & "# AS SchoolName ", #" & bulk_add_weight & "# AS ShiftWeight ", [Guard Information Query].[FullName], [Guard Information Query].[FullName], #" & bulk_add_date & "# AS DateWorked " & _
"FROM [Guard Information Query] " & _
"WHERE (( [Guard Information Query].[Active])=Yes) " & _