K
Kurt
I have a main form (frmMedicalIntake) with a tab control
(TabCtl). TabCtl has five pages which are named:
- pgIntake
- pgPhysical (has subform "frmExamPhysical")
- pgSexual (subform "frmExamSexual")
- pgLabs (subform "frmLabs")
- pgPerps (subform "frmPerps")
The main form takes a while to load due in part to all
the subforms. To improve performance, I'm trying to have
the subforms load at runtime, when the user clicks on the
tab. I tried to follow the methods described in
http://advisor.com/doc/05401 (about 2/3rds down under"
Increasing tabbed-form performance") but when I click on
a tab I get:
"Object doesn't support this property or method."
Debugging highlights the first Case listed under the
Select Case procedure of the tab control's On Change
event (in this case, "pgPhysical").
Here's what I did:
1. I set the visible properties of the subforms to False
and left the SourceObjects blank.
2. I created a class module called Class1. The article
said to assign the constants in the "Declaration section
of the form's class module," but I'm not sure if this
module is connected to the form or not. This may be the
problem.
Const pgIntake = 0
Const pgPhysical = 1
Const pgSexual = 2
Const pgLab = 3
Const pgPerp = 4
3. I added this to the On Change event of the tab control:
Private Sub TabCtl_Change()
Select Case TabCtl
Case pgPhysical
If Len(Me!frmExamPhysical.SourceObject) = 0 Then
Application.Echo True, "Loading Page, Please
wait..."
Me!frmExamPhysical.SourceObject = _
"frmExamPhysical"
Me!frmExamPhysical.Visible = True
Application.Echo True
End If
Case pgSexual
If Len(Me!frmExamSexual.SourceObject) = 0 Then
Application.Echo True, "Loading Page, Please
wait..."
Me!frmExamSexual.SourceObject = _
"frmExamSexual"
Me!frmExamSexual.Visible = True
Application.Echo True
End If
'etc.
End Select
End Sub
###
Any idea what I'm missing?
Thanks. - Kurt
(TabCtl). TabCtl has five pages which are named:
- pgIntake
- pgPhysical (has subform "frmExamPhysical")
- pgSexual (subform "frmExamSexual")
- pgLabs (subform "frmLabs")
- pgPerps (subform "frmPerps")
The main form takes a while to load due in part to all
the subforms. To improve performance, I'm trying to have
the subforms load at runtime, when the user clicks on the
tab. I tried to follow the methods described in
http://advisor.com/doc/05401 (about 2/3rds down under"
Increasing tabbed-form performance") but when I click on
a tab I get:
"Object doesn't support this property or method."
Debugging highlights the first Case listed under the
Select Case procedure of the tab control's On Change
event (in this case, "pgPhysical").
Here's what I did:
1. I set the visible properties of the subforms to False
and left the SourceObjects blank.
2. I created a class module called Class1. The article
said to assign the constants in the "Declaration section
of the form's class module," but I'm not sure if this
module is connected to the form or not. This may be the
problem.
Const pgIntake = 0
Const pgPhysical = 1
Const pgSexual = 2
Const pgLab = 3
Const pgPerp = 4
3. I added this to the On Change event of the tab control:
Private Sub TabCtl_Change()
Select Case TabCtl
Case pgPhysical
If Len(Me!frmExamPhysical.SourceObject) = 0 Then
Application.Echo True, "Loading Page, Please
wait..."
Me!frmExamPhysical.SourceObject = _
"frmExamPhysical"
Me!frmExamPhysical.Visible = True
Application.Echo True
End If
Case pgSexual
If Len(Me!frmExamSexual.SourceObject) = 0 Then
Application.Echo True, "Loading Page, Please
wait..."
Me!frmExamSexual.SourceObject = _
"frmExamSexual"
Me!frmExamSexual.Visible = True
Application.Echo True
End If
'etc.
End Select
End Sub
###
Any idea what I'm missing?
Thanks. - Kurt