Help request for simple button programming in a form

Lynx

New member
Local time
Today, 16:21
Joined
Feb 10, 2012
Messages
5
Hi to all. I am a complete ignorant in Access programming. I am trying to build a form for archiving a set of work sheets. I am stuck at a point.
I have a button (NewEntry) for moving to a new record after all data is filled. I want the text box that contains the id no of the sheet (WorkNoID) to automatically generate the next number (for example- after i finished typing the data for no 8650, i would press the NewEntry button and no.: 8651 is automatically inserted in the WorkNoID text box).
I tried to use the AutoNumber function but it doesn't work in my case cause i started working from no.8000 upwards.
I hope it is easy for someone to help... Thanks in advance :o
 
Hi,
You should use an autonumber as that's what you need. To start the autonumber from a set number like 8000 you can run an append query to add a record with the required number to the autonumber field.
 
You might use a method called DMax() + 1, a method put forward by RainLover (one of a valuable member on this Forum).. I employ that in my application, and works well for me..
 
Thanks James Dudden, that's what i did eventually. I had to sort of copy all my data to a new table to make it work, but now it does what i want it to do.
Paul Eugin i tried to implement your method but i didn't come through to make it work. I am sure to use it in the future though.
Thanks a million, i am very grateful to both for your assistance
 
Hi,
You should use an autonumber as that's what you need. To start the autonumber from a set number like 8000 you can run an append query to add a record with the required number to the autonumber field.
Do not use the autonumber to generate numbers which are important for you. When you for example. delete a record you will get gaps between the numbers.

Use solution pr2-eugin showed you.
 
I totally agree with you JHB. It is a matter of ignorance you know. I just don't manage to implement that function in my database. I am just now learning to use Access, the simplest tasks seems jibberish to me. Thanks for your tip, no need for wasting your time on this :)
 

Users who are viewing this thread

Back
Top Bottom