Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Open At Last Edited Record

Discussion in 'Information Technology' started by lmv, Nov 9, 2005.

  1. lmv

    Expand Collapse

    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
    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.

  2. Loading...

Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     

Share This Page