Counting up by 1 every time the form is selected

airhendrix13

Registered User.
Local time
Yesterday, 20:20
Joined
Dec 19, 2006
Messages
20
Hi,

I need a text box that isn't editable that counts up by 1 every time the form is selected. For example, I am assigning a number to every item added to a table. Currently I have 300 items, so from now on, when this form is selected I want it to automatically assign a number to the added item so in this case it would be 301, then next time 302 and so on.

Thanks!

Ryan
 
Code:
txtYourTextBox = DMax("YourNumber", "YourTable") + 1

This would work best in a 'Save' button command. The DMax will look up the highest value in the "YourNumber" field of "YourTable", then the code adds 1 to this number and sets it in the txtYourTextBox textbox.

To lock the textbox, set it's 'Locked' property to 'True.'
 

Users who are viewing this thread

Back
Top Bottom