VB help

vjb

Registered User.
Local time
Today, 22:36
Joined
Jul 31, 2002
Messages
14
Hello all!
Thanks for your past assistance!

Hope you can help with this one...

I have this code attached to a button on a form. The fields in the underlying table that I'm atempting to update are null.

If Me![STAA1] Is Null Then
Me![STAA1] = Me![stacurx]
Me![STADATA1] = Me![ChangeDate]
Else

When I run the code the value in [STAA1] is null and Me![stacurx] is 2 but .....

I get the error "Object Required". I'm not finding any help in Help. Maybe I'm not looking under the right topic.

When I change the code to

If Me![STAA2] = "" Then
Me![STAA2] = Me![stacurx]
Me![STADATA2] = Me![ChangeDate]
Else

It doesn't run the 2nd line of code.

If I update the values in the STAA1 field to be 0 and change the code to

If Me![STAA2] = 0 Then
Me![STAA2] = Me![stacurx]
Me![STADATA2] = Me![ChangeDate]
Else

it runs fine.

I don't want to have to update the values in those fields first.

I've set the default value of those fields in the table to be 0 and it doesn't work either.

Can anyone tell me what I'm doing wrong?

Thanks so much!
 
If isNull(Me!STAA1) Then....

is the correct syntax
 
Thank you!!
 

Users who are viewing this thread

Back
Top Bottom