Hello,
I have a form that contains 4combo box, but what I am trying to do is, that if ever the user tries to fill up the 2nd combo box before the 1st, he shouldn't be able, and if he tries to fill up the 1st, 3, 4 well he shouldn't be able to fillup the 3 and 4 combo box without filling the 2.
Therfore he has no choice to fill everything in order.
This is the code I wrote.
But it doesn't work properly.
******************
Private Sub Agt2_GotFocus()
If IsNull(Agt1) Then
Agt1.SetFocus
MsgBox "Vous devez choisir un agent", vbInformation
End If
Me.Refresh
End Sub
Private Sub Agt3_GotFocus()
If IsNull(Agt1) And _
IsNull(Agt2) Then
Agt2.SetFocus
MsgBox "Vous devez choisir un agent", vbInformation
End If
Me.Refresh
End Sub
Private Sub Agt4_GotFocus()
If IsNull(Agt1) And _
IsNull(Agt2) And _
IsNull(Agt3) Then
Agt3.SetFocus
MsgBox "Vous devez choisir un agent", vbInformation
End If
Me.Refresh
End Sub
Can someone tellme what I am doing wrong...
I have a form that contains 4combo box, but what I am trying to do is, that if ever the user tries to fill up the 2nd combo box before the 1st, he shouldn't be able, and if he tries to fill up the 1st, 3, 4 well he shouldn't be able to fillup the 3 and 4 combo box without filling the 2.
Therfore he has no choice to fill everything in order.
This is the code I wrote.
But it doesn't work properly.
******************
Private Sub Agt2_GotFocus()
If IsNull(Agt1) Then
Agt1.SetFocus
MsgBox "Vous devez choisir un agent", vbInformation
End If
Me.Refresh
End Sub
Private Sub Agt3_GotFocus()
If IsNull(Agt1) And _
IsNull(Agt2) Then
Agt2.SetFocus
MsgBox "Vous devez choisir un agent", vbInformation
End If
Me.Refresh
End Sub
Private Sub Agt4_GotFocus()
If IsNull(Agt1) And _
IsNull(Agt2) And _
IsNull(Agt3) Then
Agt3.SetFocus
MsgBox "Vous devez choisir un agent", vbInformation
End If
Me.Refresh
End Sub
Can someone tellme what I am doing wrong...