M
MarkV
How do I reference a tab control on a subform?
I have a tab control on a subform. The tab has two
pages. I want to have the "on exit" event check if any of
the controls on page two only are null, and if so to not
exit subform.
So far I am having trouble referencing the tab page. What
I have is:
----------------------------
Dim ctl As Control
Dim tbc As TabControl
Dim pge As Page
' Tabctl32 is name of tab control
' [Add New Goals] is name of page 2
Set tbc = Me!TabCtl32![Add New Goals]
' The above line is a problem, error 451 Property let
' procedure not defined and property get procedure did not
' return an object
For Each ctl In tbc
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
If IsNull(ctl.Value) Then
MsgBox "Control is null", vbOKOnly
Else
MsgBox "control is not null", vbOKOnly
End If
End If
Next ctl
End Sub
I have a tab control on a subform. The tab has two
pages. I want to have the "on exit" event check if any of
the controls on page two only are null, and if so to not
exit subform.
So far I am having trouble referencing the tab page. What
I have is:
----------------------------
Dim ctl As Control
Dim tbc As TabControl
Dim pge As Page
' Tabctl32 is name of tab control
' [Add New Goals] is name of page 2
Set tbc = Me!TabCtl32![Add New Goals]
' The above line is a problem, error 451 Property let
' procedure not defined and property get procedure did not
' return an object
For Each ctl In tbc
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
If IsNull(ctl.Value) Then
MsgBox "Control is null", vbOKOnly
Else
MsgBox "control is not null", vbOKOnly
End If
End If
Next ctl
End Sub