Will (Eval("[Forms].[Dirty]")) save data on SubForm too? RRS feed

  • Question

  • Hi

    Will this code save changed data on a SubForm too? Or is it just the data on the MainForm?

    Function Makro7()
    On Error GoTo Makro7_Err
        On Error GoTo 0
        If (Eval("[Forms].[Dirty]")) Then
            DoCmd.RunCommand acCmdSaveRecord
        End If
        DoCmd.Close , ""
        Exit Function
        MsgBox Error$
        Resume Makro7_Exit
    End Function

    Best // Peter Forss Stockholm and Sigtuna GMT +1.00

    Thursday, October 1, 2015 2:02 PM


  • Once you're out of the sub form and back on the main form, the sub form record is already saved.  In answer to your question, no, the command will only save the record of the object which has the focus.
    • Marked as answer by ForssPeterNova Thursday, October 1, 2015 2:11 PM
    Thursday, October 1, 2015 2:07 PM