L
lmv
I am trying to have my form open with the last edited record (which is a
subform). The subform is accessed by a combobox in the footer. I already have
the following so updates are verified.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "Click Yes/Save or No/Discard changes."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
Me.Undo
Cancel = True
End If
End Sub
I read that in order to have the form open the Table needed a field
LastEdited (is what I used) Date/Time set to Now() so I have done that but I
don't know HOW to put the code in the FORM'S BeforeUpdate event, set the
value of the LastUpdated field to Now()
Because I already have the above in there and I don't know how to/where to
insert it or ?? Or is it suppose to be attached to the combo box. Or is it
suppose to go after my code IF the info is updated.
Thanks!
subform). The subform is accessed by a combobox in the footer. I already have
the following so updates are verified.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
strMsg = "Data has changed."
strMsg = strMsg & "Click Yes/Save or No/Discard changes."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?") = vbYes Then
'do nothing
Else
Me.Undo
Cancel = True
End If
End Sub
I read that in order to have the form open the Table needed a field
LastEdited (is what I used) Date/Time set to Now() so I have done that but I
don't know HOW to put the code in the FORM'S BeforeUpdate event, set the
value of the LastUpdated field to Now()
Because I already have the above in there and I don't know how to/where to
insert it or ?? Or is it suppose to be attached to the combo box. Or is it
suppose to go after my code IF the info is updated.
Thanks!