I've got a subform buried under a number of levels and am have trouble referencing it.
If we call this subform I'm trying to get to CourseSubForm2, it is on the second page of tab control CourseTabControlPage2, the tab control is on a subform CourseSubForm1 and then that subform is on the main form EnrolMainForm.
Or, as a tree:
EnrolMainForm
- CourseSubForm1
- CourseTabControlPage2 (<- this is the name of the tab page, not the whole tab control)
- CourseSubForm2
I'm basically trying to get the record count of what's currently on display in CourseSubForm2 and then put that in the .Caption property of the second page of the control tab.
My attempt::
Public Sub EnrolCompAims()
Dim EnrolCompAims As String
EnrolCompAims = Trim(Forms![EnrolMainForm]![CourseSubForm1].Form![CourseSubForm2].Form.RecordsetClone.RecordCount)
Forms![EnrolMainForm]![CourseSubForm1].Form![CourseTabControlPage2].Caption = "Component Aims (" & EnrolCompAims & ")"
End Sub
No error is occurring with my above attempt, but the EnrolCompAims is equating to 0. The record I'm testing this on has 4 records in the subform that the RecordCount is being applied to.
.MoveLast). - serakfalcon.MoveLaston a recordset that has no records just gives me the error "No Current Record". - Matt Hall