Form, existing records and some fieds to fill up. Need to verify if a field is not null

C

Céline Brien

Hi,
A form with existing records with some fields alresay fill up and other
field to fill up.
I need to verify if the field Consultant is fill up.
Something like that :
-------------------------------------------
Private Sub Form_AfterUpdate()
If Me.Consultant Is Null Then
MsgBox ("Vous devez remplir le champ Consultant"), vbOKOnly, "Remplir le
champ Consultant"
??? Go back to Record and the field Consultant ???
End If
End Sub
 
S

Svetlana

On before update event of your form check the value of Consultant as
like

If Nz(Me.Consultant)="" Then ' if Consultant is a text data type or
If Nz(Me.Consultant)=0 Then ' if Consultant is a number data type

MsgBox "Vous devez remplir le champ Consultant", vbOKOnly, "Remplir
le champ Consultant"
Cancel=True
Me.Consultant.SetFocus

End If
 
C

Céline Brien

Thank you for your answer.
It is working perfectly !
Have a good day.
Céline
 
Top