Help Writing VB Code (1 Viewer)

ccflyer

Registered User.
Local time
Today, 11:53
Joined
Aug 12, 2005
Messages
90
Hi, I am just wondering if anyone would be able to help me write a section of VB code, since I really don't know VB very good.

Here is what I am going for:

Code:
If (([stock]-[stockbefore]+[sales]) == [oil])
   { Print in Text box "OK" }
Else
   { Print in Text box "Error" }

These fields are on a form called "Daily" and my text box to print in is called "errorbox".

Any help would be greatfully appreciated,
Chris
 

FoFa

Registered User.
Local time
Today, 12:53
Joined
Jan 29, 2003
Messages
3,672
If the form is current, and these fields are form fields:
If ((Me.stock-Me.stockbefore+Me.sales]) = Me.oil) Then
Me.errorbox = "OK"
Else
Me.errorbox = "Error"
End If
 

ccflyer

Registered User.
Local time
Today, 11:53
Joined
Aug 12, 2005
Messages
90
Hey Thanks FoFa, it worked!!!

I couldn't have done it without you!

-Chris
 

Users who are viewing this thread

Top Bottom