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])
 
Top