HELP WITH THIS CODE

danaleblanc

Registered User.
Local time
Today, 11:26
Joined
Jun 13, 2001
Messages
41
Have a checkbox called RUSHORDER
Have a text box called UNITPRICE (formated in currency)
Need a code that will increase the value in UNITPRICE by 30% if RUSHORDER is selected.
Any help is appreciated.
 
Where you put your code to do this depends on which action happens first. If the UnitPrice is filled in and then the Check box is check you will need the code in the After Update event of the Check box. If the Check box is ALWAYS checked first then this code in the After Update event of the UnitPrice field will work. You might want to use code in the Before Update event with a warning message to let the user know that the price is going to be increased. If they don't want the increase then they can exit without saving a price to the table.

Anyway, the code for the After Update event of the UnitPrice field will look like this:

If Me.RUSHORDER = -1 Then
Me.UnitPrice = Me.UnitPrice * 1.3
End if

[This message has been edited by Jack Cowley (edited 11-17-2001).]
 

Users who are viewing this thread

Back
Top Bottom