Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reduce value of a field

Status
Not open for further replies.

jball

Technical User
Nov 7, 2001
33
0
0
GB
I need to reduce the value of a field by one when data is entered in another field. Anyone got any ideas of how to do this in VB.
 


Using a form to enter data,you need to trigger an event
procedure when you've entered the data in the other field.

To do this look in the properties of the other field in the Event section - click into 'On Lost Focus' or 'On Change', and select the 'Event Procedure' then 'Code Builder':

Use the following code:

x=[yourfieldname].value
x=x-1
[yourfieldname].value=x

ok?
 
Do I need to replace x with anything, or am I classing it as a variable?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top