Naming Tabs from Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with 7 tabs that are labeled "Indicator A", "Indicator B",
"Indicator C", etc. Within each tab, there is a combo box, whose choice I
would like to be the label for the Tab. This would change when the user makes
a choice from the combo box, which is called "Indicator". The text from this
combo box would ideally become the label for the tab, so each tab is called
something more meaningful than "Indicator A", but might be called "Percent
Participation" (which is one of the choices).

Someone suggested using something like this in the combobox's AfterUpdate
event:

With Me.XXX 'replace XXX with the name of tab control
.Pages(.Value).Caption = Me.ActiveControl.Value
End With

It works, though I cannot get the tab name to stay that way when you exit
and then restart the database. It defaults back to Indicator A, etc. I have
tried using Requery in the form or the fields but to no avail.

Any suggestions?

Thanks in advance.

- Steve
 
That is because the form is not saved when you close it unless you specify
saving it:

DoCmd.Close acForm, "MyForm", acSaveYes
 
Back
Top