K
Karen
I have a tab control on a form. When I click a 'Reset' command button I want to cycle through the controls on the active page and reset them to particular values. I know I can find the current active index with currentindex= Me!TabCtl0.Value. I've tried this code but it doesn't work, I get an error "type mismatch". I know I must not be referring to the controls on the active tab correctly. Any gurus out there that can show me the way?
Dim ctl as Control
Dim intPage as Integer
intPage = Me!TabCtl0.Value
For Each ctl In Me.TabCtl0(intpage) 'error fires on this line
With ctl
Select Case ctl.ControlType
Case acTextBox
MsgBox ("this is a textbox")
End Select
End With
Next ctl
Karen
Dim ctl as Control
Dim intPage as Integer
intPage = Me!TabCtl0.Value
For Each ctl In Me.TabCtl0(intpage) 'error fires on this line
With ctl
Select Case ctl.ControlType
Case acTextBox
MsgBox ("this is a textbox")
End Select
End With
Next ctl
Karen