G
Guest
Posted this question a few weeks ago but never got an answer... and I don't
know a way to get it back to focus other than reposting. Anyway...
I am trying to have my form open with the last edited record (which is a
subform). The subform info 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.
I just want the form to open in the category where was last working. The
category is chosen by the combobox it doesn't actually have to open in the
exact record just in the last category... either way. Is this possible?
Thanks!
know a way to get it back to focus other than reposting. Anyway...
I am trying to have my form open with the last edited record (which is a
subform). The subform info 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.
I just want the form to open in the category where was last working. The
category is chosen by the combobox it doesn't actually have to open in the
exact record just in the last category... either way. Is this possible?
Thanks!