help with code

octatyan

Registered User.
Local time
Today, 09:48
Joined
Jan 10, 2003
Messages
36
Hi, I have a form that displays amendments made to contracts.

In this form there is a text box called AMENDMENT #. So the first amendment will show a "1". The second amendment will show a "2", etc...

Whenever a person enters a new amendment, how do I make it so that the AMENDMENT # textbox automatically inserts the next number in sequence. I assume you would have to code this somehow like this:

if ADD AMENDMENT button is pressed then
the AMENDMENT # textbox = (largest amendment #) + 1

here are a few other details that might be important:

1. This form has multiple contracts, so I assume you can't use AUTONUMBER because I would like all contracts (contract A, B, C, etc....) to all start with amendment #1.

2. This form is actually a main form, with a subform. the main form has all the contract information. the sub form has the amendment information (and the AMENDMENT # textbox).

Any suggestions anyone????

thanks
 
This is regularly done using a DMax aggregate function. Look up DMax in help or search the forum here as there are stacks of examples.
 

Users who are viewing this thread

Back
Top Bottom