Help with an If statement..

Maclain

Registered User.
Local time
Today, 21:56
Joined
Sep 30, 2008
Messages
109
Morning all.

I'm trying to place an if statement in an afterupdate event on a form.

the code I have is

Code:
If [Customer] Like "BRO001" And [Inv No] is null Then [Job_Price] = [Shots] * 27.5

this gives me a run time error, object required and highlights
Code:
If [Customer] Like "BRO001" And [Inv No] Is Null Then

I'd like the code to do nothing where the requirements to alter the job price are not met.

where am I going wrong?
 
Try the Before Update event to begin with. now what are the data types of the Fields Customer and Inv No?
 
Is Null is SQL "langauge" in vba you use a function IsNull ([Inv no]) to chech for null values.
 
changing
Code:
 [Inv No] is null
to
Code:
 Isnull ([Inv No])
worked.

TVM once again :)

The Like "BRO001" could be = BRO001 as this is a unique identifier to the customer.

But I understand the need for the enclosed *
 
if it's a unique identifier don't use Like use =
If [Customer] = "BRO001"
 

Users who are viewing this thread

Back
Top Bottom