I continue to have problems with "not saving a record" until all data fields are complete....
I have reduced my database to as simple as it can be:
tblPINcode tblDateTime
PinCode (Prim.Key) DateId
LastName PinCode (for.Key)
FirstName Today (Date Function)
TimeIn (Time Function)
TimeOut (Time Function)
There is a mainform(PinCode,LastName,FirstName) and a subform(Today,TimeIn,TimeOut). The fields in the subform are populated with the following code:
Private sub form_Load()
Me.Today=Date
If IsNull(Me.TimeIn)Then
Me.TimeIn=Time
ElseIf IsNull(Me.TimeOut) Then
Me.TimeOut=Time
End If
End Sub
My problem is I can't get the record to "save" at the right time. I've used the data entry property set to "yes". This caused the Date and TimeIn to be "saved" in the table on a row different from TimeOut. (I couldn't figure out how to get to the next step:ElapsedTime:[TimeOut]-[TimeIn].
I tried using an update event with DoCmd.RunCommand acCmdSaveRecord, but this didn't work.
How can I make my database "wait" until "TimeOut" is entered to save the three pieces of data (Today,TimeIn,TimeOut)on the same row in the table, and, at the same time, insure that the next day's record will not replace the one I'm trying to save...
I have reduced my database to as simple as it can be:
tblPINcode tblDateTime
PinCode (Prim.Key) DateId
LastName PinCode (for.Key)
FirstName Today (Date Function)
TimeIn (Time Function)
TimeOut (Time Function)
There is a mainform(PinCode,LastName,FirstName) and a subform(Today,TimeIn,TimeOut). The fields in the subform are populated with the following code:
Private sub form_Load()
Me.Today=Date
If IsNull(Me.TimeIn)Then
Me.TimeIn=Time
ElseIf IsNull(Me.TimeOut) Then
Me.TimeOut=Time
End If
End Sub
My problem is I can't get the record to "save" at the right time. I've used the data entry property set to "yes". This caused the Date and TimeIn to be "saved" in the table on a row different from TimeOut. (I couldn't figure out how to get to the next step:ElapsedTime:[TimeOut]-[TimeIn].
I tried using an update event with DoCmd.RunCommand acCmdSaveRecord, but this didn't work.
How can I make my database "wait" until "TimeOut" is entered to save the three pieces of data (Today,TimeIn,TimeOut)on the same row in the table, and, at the same time, insure that the next day's record will not replace the one I'm trying to save...