Referencing tab control in code

  • Thread starter Thread starter Paco
  • Start date Start date
P

Paco

I need to change the index value of a tab control using a function. I can
hard code it thus:

Forms!frmBuilding!tabBuilding.Value = 0

But I can't figure out how to pass the correct parameters to the function.

I've tried passing the name of the form as a string and referencing the
string, but that doesn't work. Any suggestions?

Thanks.
 
Paco said:
I need to change the index value of a tab control using a function. I can
hard code it thus:

Forms!frmBuilding!tabBuilding.Value = 0

But I can't figure out how to pass the correct parameters to the function.

I've tried passing the name of the form as a string and referencing the
string, but that doesn't work. Any suggestions?

Thanks.

Is this the kind of thing you mean?

Public Function SetTabValue(TabCtrl As Access.Control, Value As Long)
TabCtrl.Value = Value
End Function

Call it like this:

SetTabValue Me.MyTabControl, 0
 
Back
Top