If statement in before update event

S

Scott

When I run below event, there is syntax error about If statement. I got no
clue about it. Can someone point me out where is the error.

Private Sub txtFieldC_BeforeUpdate(Cancel As Integer)

If Not IsNull([FieldA]) AND IsNull([FeildB)] Then

MsgBox "The FieldB is empty. Please fill that first!"

Cancel = True

End If

End Sub

Thanks,

Scott
 
F

fredg

When I run below event, there is syntax error about If statement. I got no
clue about it. Can someone point me out where is the error.

Private Sub txtFieldC_BeforeUpdate(Cancel As Integer)

If Not IsNull([FieldA]) AND IsNull([FeildB)] Then

MsgBox "The FieldB is empty. Please fill that first!"

Cancel = True

End If

End Sub

Thanks,

Scott

You've mixed up the closing parenthesis and closing bracket.

IsNull([FeildB)] should be
IsNull([FeildB])
 
S

Scott

Fredg,

How come I made such silly mistake!! Thanks a million!

Scott

fredg said:
When I run below event, there is syntax error about If statement. I got
no
clue about it. Can someone point me out where is the error.

Private Sub txtFieldC_BeforeUpdate(Cancel As Integer)

If Not IsNull([FieldA]) AND IsNull([FeildB)] Then

MsgBox "The FieldB is empty. Please fill that first!"

Cancel = True

End If

End Sub

Thanks,

Scott

You've mixed up the closing parenthesis and closing bracket.

IsNull([FeildB)] should be
IsNull([FeildB])
 

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

Top