Results 1 to 2 of 2
  1. #1
    Join Date
    May 2010

    Unanswered: Does anyone use the fsubnavigation tool supplied by Access 2002 Handbook?


    Is anyone familiar with the fsubnavigation tool supplied by Access 2002 Desktop Developer's Handbook by Litwin, Getz, and Gunderloy.

    I would like to use it in my form, but I do not completely understand how to connect it to the mainform correctly.

    I added the subform to the mainform. But as soon as the sub form is loaded, the following code is immediately executed. I have not accessed the recordset of the mainform and am getting (3021, "No Current Record") from within the subform code. Any guidance is very much appreciated.

    Why does the subform immediately execute?

    Private Sub Form_Load()
    mblnIsSubform = IsSubForm(Me)
    If mblnIsSubform Then
    Set frmMain = Me.Parent

    ' Code won't run unless the words
    ' "[Event Procedure]" show up in the
    ' main form's event properties.
    frmMain.OnCurrent = "[Event Procedure]"
    frmMain.OnDirty = "[Event Procedure]"
    frmMain.OnUndo = "[Event Procedure]"

    ' Calculate the total number of records?

    If adhcCalcTotalRecs Then
    Dim rst As DAO.Recordset
    Set rst = frmMain.RecordsetClone
    txtTotalRecs = rst.RecordCount
    Set rst = Nothing
    End If
    End If

    Exit Sub

    Thank you!

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    Because the Load event occurs when a form (or in your case a subform) is loaded.
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts