Hi everyone, I have a little problem when I try to set focus back to the textbox after displaying a message when you try to the next textbox without writing something in the first one.
Here's my code:
Private Sub ZT_Prenom_LostFocus()
If Nz(ZT_Prenom.Value) = vbNullString Then
MsgBox "Vous devez entrer un prénom pour continuer."
ZT_Prenom.SetFocus
End If
End Sub
Can somebody tell me what to do in order to set the focus back to the ZT_Prenom textbox ? ZT_Prenom.SetFocus doesn't work in the actual context.
Thanks
Here's my code:
Private Sub ZT_Prenom_LostFocus()
If Nz(ZT_Prenom.Value) = vbNullString Then
MsgBox "Vous devez entrer un prénom pour continuer."
ZT_Prenom.SetFocus
End If
End Sub
Can somebody tell me what to do in order to set the focus back to the ZT_Prenom textbox ? ZT_Prenom.SetFocus doesn't work in the actual context.
Thanks