KevinSlater
Registered User.
- Local time
- Today, 20:42
- Joined
- Aug 5, 2005
- Messages
- 249
hi does anyone know whats wrong with this bit of code?, the bit up to the "where" line works fine (ie if i take the where bit out it will work), however i would like to copy only employees on a particular shiftname, instead of copying all of them from the employee shift table.
Private Sub Form_AfterUpdate()
Dim SQL_Text As String
SQL_Text = "INSERT INTO ATTENDANCE (SHIFTNAME, SHIFT_DATE, EMPLOYEE_NUMBER) SELECT '" & Me.SHIFTNAME & "','" & Me.SHIFT_DATE & "'" & " ,EMPLOYEE_NUMBER FROM [EMPLOYEE SHIFT] WHERE ([EMPLOYEE SHIFT].SHIFTNAME)"
DoCmd.RunSQL (SQL_Text)
End Sub
Private Sub Form_AfterUpdate()
Dim SQL_Text As String
SQL_Text = "INSERT INTO ATTENDANCE (SHIFTNAME, SHIFT_DATE, EMPLOYEE_NUMBER) SELECT '" & Me.SHIFTNAME & "','" & Me.SHIFT_DATE & "'" & " ,EMPLOYEE_NUMBER FROM [EMPLOYEE SHIFT] WHERE ([EMPLOYEE SHIFT].SHIFTNAME)"
DoCmd.RunSQL (SQL_Text)
End Sub
Last edited: