I keep getting Data Type Conversion Error 3421 on the following. Debug stops on !TimeInI = Me.TimeInI.Value.
Also, I don't get the error when I open the database and save the first record. It happens only when I try to save the second record.
Set db = CurrentDb
Set rst = db.OpenRecordset("Data")
With rst
.AddNew
!StudentFullName = Me.StudentFullName
!Staff1 = Me.Staff1
!Staff2 = Me.Staff2
!Staff3 = Me.Staff3
!Staff4 = Me.Staff4
!Staff5 = Me.Staff5
!cDate = Me.cDate
!Reason1 = Me.Reason1
!Reason2 = Me.Reason2
!Type1 = Me.Type1
!Type2 = Me.Type2
!Type3 = Me.Type3
!TimeInI = Me.TimeInI.Value
!TimeOutI = Me.TimeOutI.Value
!TimeInR = Me.TimeInR.Value
!TimeOutR = Me.TimeOutR.Value
!Room = Me.Room
!Door = Me.Door.Value
!ConstantContact = Me.ConstantContact.Value
!Checks = Me.Checks
.Update
End With
rst.Close
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "CLEARME" Then ctl.Value = ""
Next ctl
Also, I don't get the error when I open the database and save the first record. It happens only when I try to save the second record.
Set db = CurrentDb
Set rst = db.OpenRecordset("Data")
With rst
.AddNew
!StudentFullName = Me.StudentFullName
!Staff1 = Me.Staff1
!Staff2 = Me.Staff2
!Staff3 = Me.Staff3
!Staff4 = Me.Staff4
!Staff5 = Me.Staff5
!cDate = Me.cDate
!Reason1 = Me.Reason1
!Reason2 = Me.Reason2
!Type1 = Me.Type1
!Type2 = Me.Type2
!Type3 = Me.Type3
!TimeInI = Me.TimeInI.Value
!TimeOutI = Me.TimeOutI.Value
!TimeInR = Me.TimeInR.Value
!TimeOutR = Me.TimeOutR.Value
!Room = Me.Room
!Door = Me.Door.Value
!ConstantContact = Me.ConstantContact.Value
!Checks = Me.Checks
.Update
End With
rst.Close
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "CLEARME" Then ctl.Value = ""
Next ctl