G
Gaetanm
I’m new at this and trying very hard. Can anyone help?
My table that needs to be updated is Clock_Table
The table has four (4) fields JobId, EmployeeID, StartDate, StopDate
My form called StopTime has a combo box bound to this table.
The combo does a query EmployeeID that StartDate is not Null and StopDate
Is Null. The combo box display the EmployeeId. I have a field on the Form
that is populated via a button that has the Now statement. That part works.
I’m trying to update the existing row to the table with the Employee value in
the combo box as point of reference and update StopDate in the table with the
StopDate data
that was put on the form via the Now statement.
I tried with the following code via a command button but its not working It
comes up with a dialogue box asking to put the variable in then another
dialogue box pops telling me 0 records will be updated .
Private Sub Command21_Click()
Dim SQLstrg As String
SQLstrg = "Update Clock_Table Set EmployeeId = [EmployeeId].[Column(1)],
StopDate = [StopDate] Where StopDate = Null"
DoCmd.RunSQL SQLstrg
End Sub
Can anyone please help
My table that needs to be updated is Clock_Table
The table has four (4) fields JobId, EmployeeID, StartDate, StopDate
My form called StopTime has a combo box bound to this table.
The combo does a query EmployeeID that StartDate is not Null and StopDate
Is Null. The combo box display the EmployeeId. I have a field on the Form
that is populated via a button that has the Now statement. That part works.
I’m trying to update the existing row to the table with the Employee value in
the combo box as point of reference and update StopDate in the table with the
StopDate data
that was put on the form via the Now statement.
I tried with the following code via a command button but its not working It
comes up with a dialogue box asking to put the variable in then another
dialogue box pops telling me 0 records will be updated .
Private Sub Command21_Click()
Dim SQLstrg As String
SQLstrg = "Update Clock_Table Set EmployeeId = [EmployeeId].[Column(1)],
StopDate = [StopDate] Where StopDate = Null"
DoCmd.RunSQL SQLstrg
End Sub
Can anyone please help