Forum

Test Value of Comob...
 
Notifications
Clear all

Test Value of ComoboBox in Userform

3 Posts
2 Users
0 Reactions
75 Views
(@stevenbehr1)
Posts: 92
Estimable Member
Topic starter
 

Hi,

 

Im doing a Hazard Module and one of the combo boxes that has a "yes" or "No"dropdown question.

The VBA userform formula below is what I wanted but doesn't seem to work well.

Private Sub Reg29_Change()
If Me.Reg29.Enabled = True Then
Me.Reg30.Text = "Not Entered"
End If
End Sub

 

So if Reg29 selects No then in Reg30 Textbox " Not Entered"

Or If Reg29 Selects Yes Reg30 textbox then blank.

Thanks

 

Steve

 
Posted : 13/02/2020 4:45 pm
Philip Treacy
(@philipt)
Posts: 1632
Member Admin
 

Hi Steve,

That code isn't checking the value in the ComoboBox.  Try this

Private Sub Reg29_Change()
If Me.Reg29.Value = "No" Then
Me.Reg30.Text = "Not Entered"
Else
Me.Reg30.Text = ""
End If
End Sub

Regards

Phil

 
Posted : 13/02/2020 9:07 pm
(@stevenbehr1)
Posts: 92
Estimable Member
Topic starter
 

Thanks Phil,

 

I almost had it!

 

But thanks

 

SteveLaugh

 
Posted : 13/02/2020 9:23 pm
Share: