Require Field Entry based On Other Entry

P

PPCO

I'm trying to Require Entry in a Field on a form if another field has a
certain entry. I've tried the following code in Before Update:
If Me![Customer]="Mutual" and IsNull(Me![Returns]) Then
MsgBox "You must enter a value in Returns."
Cancel = True
[Returns].SetFocus

But it's giving me the error message:
"Block IF without End IF"

Thanks!
 
D

Duane Hookom

That's one of the more accurate error messages

If Me![Customer]="Mutual" and IsNull(Me![Returns]) Then
MsgBox "You must enter a value in Returns."
Cancel = True
[Returns].SetFocus
End If '<-- add this line as the error message suggests
 
P

PPCO

LOL, sorry to waste your time! I copy and pasted from another post.
Duane Hookom said:
That's one of the more accurate error messages

If Me![Customer]="Mutual" and IsNull(Me![Returns]) Then
MsgBox "You must enter a value in Returns."
Cancel = True
[Returns].SetFocus
End If '<-- add this line as the error message suggests

--
Duane Hookom
Microsoft Access MVP


PPCO said:
I'm trying to Require Entry in a Field on a form if another field has a
certain entry. I've tried the following code in Before Update:
If Me![Customer]="Mutual" and IsNull(Me![Returns]) Then
MsgBox "You must enter a value in Returns."
Cancel = True
[Returns].SetFocus

But it's giving me the error message:
"Block IF without End IF"

Thanks!
 

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

Similar Threads


Top