Hi there
Thank you in advance for taking the time to check this out.
Objective:
I have 2 combo boxes, one is dependent on what has been selected in the first combo box (dynamic named range), they work fine except for an irritating error when the user accidentally clicks in the empty
Cmbox_IncCategory and it wont allow the user to go back to the
cmbx_Category_Type box if the user forgot he had to make a selection from that first before selecting the
Cmbox_IncCategory.
The error that pops up is Invalid property value.
I tried having text in there to say please select from Cmbox_IncCategory first, but that didnt fix it.
I tried to If error resume next but that didnt like it either. Now I am stumped.
Main combo box= cmbx_Category_Type
2nd combo box (displaying a list dependent on what was selected in Main combo box)= Cmbox_IncCategory
I know there must be a way to fix it so that if a user clicks on the combo box, but doesnt make a selection it wont lock up the form.
Yes, it is a mandatory field, and I was considering using a message box to advise the user that this must be completed, but I am not sure how to do it (and avoid the errors
)
Heres the current code I have for the combo boxes.
Me.Cmbox_IncCategory = "" 'Clears the contents of the 2nd combobox when another category is chosen On Error Resume Next 'I can't seem to have the Incident Category combobox to be empty when the form is open _ I have tried Cmbox_IncCategory.Value = "", but I get an error. I then tried Cmbox_IncCategory.text = "" _ but also get the error. I don't know how else to get it to work .. I tried both codes in the _ form_initialize, but get an error ... I'm stumped ! Select Case Me.cmbx_Category_Type Case "Crime" Me.Cmbox_IncCategory.RowSource = "Inc_Cat_CRIME" Case "Property Damage - Minor - NS" Me.Cmbox_IncCategory.RowSource = "Inc_Cat_PROPRTY_NS" Case "Property Damage - Significant - S" Me.Cmbox_IncCategory.RowSource = "Inc_Cat_Proprty_S" Case "Safety" Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SAFETY" Case "Security Breach" Me.Cmbox_IncCategory.RowSource = "Inc_Cat_BREACH_S" Case "Support" Me.Cmbox_IncCategory.RowSource = "Inc_Cat_SUPPORT" Case "Vehicle" Me.Cmbox_IncCategory.RowSource = "Inc_Cat_VEHICLE_S" End Select End SubId be really grateful if someone could help me out, or perhaps direct me to where I might find some coding that will achieve the result I am seeking.
With much gratitude,
TheShyButterfly