combobox code not running except afterupdate

Udaman

New Member
Joined
Feb 17, 2016
Messages
43
I have a bound combo-box with 5 choices that simply hides or shows different controls based on selection. I made it bound so that the value is retained when the form is closed and reopened. However, despite the value being remembered, the code doesn't run unless I re-select an option from the list. I have read numerous posts, but I can't quite find one that deals with this issue specifically. My best guess is that my form needs to run the code every time it opens (perhaps the On Current or On Load events?), but that is where I need help in figuring out where, and what code I need to use. Any suggestions?

Here are some details:

My form is called "BulbsQueryForm"
The Combobox is called "AssetModel"

Here is my code for the combo box set in the After Update Event Procedure:

Code:
Private Sub AssetModel_AfterUpdate()If AssetModel.Value = "Tundra" Then
      Me.TwoPlateCheck.Visible = True
      Me.TwoPlateRR.Visible = True
      Me.PlateCheck.Visible = False
      Me.PlateRR.Visible = False


 Else
      Me.TwoPlateCheck.Visible = False
      Me.TwoPlateRR.Visible = False
      Me.PlateCheck.Visible = True
      Me.PlateRR.Visible = True


 End If


End Sub

Any suggestions?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Yes, run your code in a form open event. Have you tried it?
 
Upvote 0
Yes, it worked on the Open event. Thanks for the tip, I was hoping I was on the right track. Someday I might even be able to help answer some of these posts!
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,693
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top