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

  • Thread starter Thread starter Céline Brien
  • Start date Start date
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
 
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
 
I think...

Me.Consultant.SetFocus

....will do what you want...

Ross La Haye
 
Thank you for your answer.
It is working perfectly !
Have a good day.
Céline
 
Thank you for your answer.
Me.Consultant.SetFocus is doing the job !
Have a good day.
Céline

"Klein-4" <[email protected]> a écrit dans le message de (e-mail address removed)...
I think...

Me.Consultant.SetFocus

....will do what you want...

Ross La Haye
 
You're welcome. :-)

Ross La Haye

Céline Brien said:
Thank you for your answer.
Me.Consultant.SetFocus is doing the job !
Have a good day.
Céline

"Klein-4" <[email protected]> a écrit dans le message de (e-mail address removed)...
I think...

Me.Consultant.SetFocus

...will do what you want...

Ross La Haye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top