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!

autonumber

Status
Not open for further replies.

debbie14

Programmer
Apr 11, 2005
5
0
0
CY
Hi, everyone! I'm new in programming and I need all the help I can get. I want an autonumber to appear in a text box. I've managed that, the code is working properly but the propblem is that each time I run the progrm the number starts again from 1. Is there any way to solve that? Maybe by saving it somewhere and retrieve it afterwards? Any solutions?
 
That works for random numbers. I need autonumber, increased by 1 each time.
 
Use SaveSetting and GetSetting

In the Form Unload event, add:
SaveSetting "NameofMyprogramme", "Settings", "AutoNumber", AutoNumber

and in the Form Load Event, add:
AutoNumber = GetSetting("NameofMyprogramme", "Settings", "AutoNumber", 1)

Note that the number 1 in getSetting is the default which will be overwritten by the value of your AutoNumber if it exists.

Alan

[gray]Experience is something you don't get until just after you need it.[/gray]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top