question on Combobox

S

SF

Hi,

I have 4 comboboxes for Province, District, Commune and Village. I am able
to set an cascade update to filter the desire data based from selection on
different combos. I observed that some time user click dirrectly on district
conbobox without selecting province. I want to display a message notifying
user that they have to select a province first before proceeding to district
level.

What event should I use to check if province combo box is empty and kick the
msgbox to start?

SF
 
D

Dirk Goldgar

SF said:
Hi,

I have 4 comboboxes for Province, District, Commune and Village. I am
able to set an cascade update to filter the desire data based from
selection on different combos. I observed that some time user click
dirrectly on district conbobox without selecting province. I want to
display a message notifying user that they have to select a province
first before proceeding to district level.

What event should I use to check if province combo box is empty and
kick the msgbox to start?

You could use the Enter or GotFocus event. Something like ...

Private Sub District_Enter()

If IsNull(Me!Province) Then
MsgBox "Please select a province first."
Me!Province.SetFocus
End If

End Sub
 
Top