Hello,
Thank you so much for your answer.
When the field ccPrive is true, the number of hours should be entered in
the field HrsLeger and not in the field HrsHPLeger.
So I would like to cancel the selection of the HrsHPLeger field and bring
the user to the field.HrsLeger.
To simplify, I used your code and I still receive the following error
message :
--------------------------------------------------------
L'expression Sur entrée entrée comme paramètre de la propriété de type
événement est à l'origine d'une erreur. Utilisation incorrecte de la
propriété.
* Le résultat de l'expression n'est pas le nom d'une macro, le nom d'une
fonction définie par l'utilisateur ou [Event Procedure].
* Une erreur a peut-être été commise lors de l'évaluation d'une fonction,
d'un événement ou d'une macro.
--------------------------------------------------------
Can you help ?
Céline
Al Campagna said:
Celine,
Whenever you receive an error message... please include that in your
post.
At first glance, the Enter event doesn't have a Cancel, and you
shouldn't have to SetFocus when you have already entered the field.
Try this...
Private Sub HrsHPLeger_Enter()
If Me.[ccPrive] = -1 Then
MsgBox "Membre privé", vbOKOnly, "Saisir les heures dans le champ
HrsLeger"
End If
End Sub
Every time you enter HrsHPLeger, and your ccPrive field = -1, the
MsgBox will fire.
Bon Chance!
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html
"Find a job that you love... and you'll never work a day in your
life."
Hi everybody,
I receive an error message when I select HreHPLeger.
Can you help ?
Many thanks,
Céline
Private Sub HrsHPLeger_Enter()
If ([ccPrive] = -1) Then
MsgBox "Membre privé", vbOKOnly, "Saisir les heures dans le champ
HrsLeger"
Cancel = True
Me.HrsLeger.SetFocus
End If
End Sub