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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Pass parameter to query from code 5
Find Record 1
Is it worth the effort?? 1
Pass Control as Argument 3
Referencing Subforms 1
VBA to clear controls 2
Need Tab Control Advice 2
WHERE Statement for OpenRecordset 3

Back
Top