G
Gaetanm via AccessMonster.com
I have a table [Clock_table] On it I have a [EmployeeId] I have Two Forms
[frmClockk_start_table] and
[frmClock_stop_table].
I did not have the [EmplyeeId] specified as required and
Users neglected to pull down their Employee ID and I ended up
with a Null in the field. I fixed that by making the [EmployeeID] required.
This part of the process Identifies the [EmployeeID] the [Job_ID] and the
[start_time].
The Problem occurs when they want to close the job
on the [frm_Clock_Stop_Table]
Below is the error message and my UPDATE SQL
for [frm_Clock_Stop_Table].
The form updated fine until I made [EmployeeID]
a required field
Run-Time Error -2147352567 (800200009)
The field ‘Clock_TableId’ cannot contain a Null value because the Required
property for this field is set to true Enter a value in this field
Private Sub RECORD_Click()
DoCmd.SetWarnings False
Dim SQLstrg As String
SQLstrg = "UPDATE Clock_Table SET [StopDate] = #" & _
Me.StopDate & "#, [Activity]='" & _
[Forms]![frmClock_Stop_Table]![txtJob_Activity] & _
"' WHERE (([StopDate] Is Null) And ([EmployeeID] = " & _
Me.[EmployeeID] & "));"
DoCmd.RunSQL SQLstrg
DoCmd.SetWarnings True
Me.cboEmployeeID = Null
Me.StopDate = Null
Me.txtJob_Activity = Null
DoCmd.OpenForm "frmclock_start_table"
DoCmd.SelectObject acForm, "frmclock_start_table"
End Sub
Any Ideas
Gaetanm
[frmClockk_start_table] and
[frmClock_stop_table].
I did not have the [EmplyeeId] specified as required and
Users neglected to pull down their Employee ID and I ended up
with a Null in the field. I fixed that by making the [EmployeeID] required.
This part of the process Identifies the [EmployeeID] the [Job_ID] and the
[start_time].
The Problem occurs when they want to close the job
on the [frm_Clock_Stop_Table]
Below is the error message and my UPDATE SQL
for [frm_Clock_Stop_Table].
The form updated fine until I made [EmployeeID]
a required field
Run-Time Error -2147352567 (800200009)
The field ‘Clock_TableId’ cannot contain a Null value because the Required
property for this field is set to true Enter a value in this field
Private Sub RECORD_Click()
DoCmd.SetWarnings False
Dim SQLstrg As String
SQLstrg = "UPDATE Clock_Table SET [StopDate] = #" & _
Me.StopDate & "#, [Activity]='" & _
[Forms]![frmClock_Stop_Table]![txtJob_Activity] & _
"' WHERE (([StopDate] Is Null) And ([EmployeeID] = " & _
Me.[EmployeeID] & "));"
DoCmd.RunSQL SQLstrg
DoCmd.SetWarnings True
Me.cboEmployeeID = Null
Me.StopDate = Null
Me.txtJob_Activity = Null
DoCmd.OpenForm "frmclock_start_table"
DoCmd.SelectObject acForm, "frmclock_start_table"
End Sub
Any Ideas
Gaetanm