Help Writing VB Code

ccflyer

Registered User.
Local time
Yesterday, 18:03
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
 
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
 
Hey Thanks FoFa, it worked!!!

I couldn't have done it without you!

-Chris
 

Users who are viewing this thread

Back
Top Bottom