Combo box list field question

  • Thread starter Thread starter Alex Anderson
  • Start date Start date
A

Alex Anderson

Hello everyone,

I'm fairly new to Access but I created a combo box (list field) to list
some values. I want those values to enable and disable depending on their
relationship to the page of a tab. I'm not sure to use expressions or is
VBA involved to accomplish my purpose? When a user selects a value, and
depending on that value I want it to disable or enable that page for
editing. I was thinking it would be cleaner to make the Page on the Tab to
completely disappear but from a learning standpoint that in my eyes is too
advance. Could someone give me some instruction or insight how to tackle
this? Much appreciated.

Thank you
Alex Anderson
 
Hello everyone,

I'm fairly new to Access but I created a combo box (list field) to list
some values. I want those values to enable and disable depending on their
relationship to the page of a tab. I'm not sure to use expressions or is
VBA involved to accomplish my purpose? When a user selects a value, and
depending on that value I want it to disable or enable that page for
editing. I was thinking it would be cleaner to make the Page on the Tab to
completely disappear but from a learning standpoint that in my eyes is too
advance. Could someone give me some instruction or insight how to tackle
this? Much appreciated.

Thank you
Alex Anderson

You can use the AfterUpdate event of the combo to set the Enabled (or
Visible, they're equivalently easy) as you wish. Try something like:

Private Sub cboMyCombo_AfterUpdate()
Select Case cboMyCombo
Case "This"
Me!pg2.Visible = True
Case "That"
Me!pg2.Visible = False
End Select
End Sub

Using the "Enabled" property instead of the "Visible" property will
leave the tab page visible, but it will be greyed out and cannot be
selected.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
If I may ask, how would one put that in the form. In other words, where
would I place the below code.
 
Back
Top