i want to auto generate an ID like 1, 2, 3.
and anytime i close my application and open it again it should start from the Id it stopped.
if i enter up to 6 the next one should be 7.
Can anybody help me?

Use to save the last number auto number in a separate table so that whenever you add another record, get the last number and then add one number for a new auto number and then update the last number in the Autonumber Table again. In this way, you can simply make auto number.

eg. lastno=Last number stored in the table
lastno=Val(lastno)+1

You can Save the Last Auto number using database table or using Text File.

Use to save the last number auto number in a separate table so that whenever you add another record, get the last number and then add one number for a new auto number and then update the last number in the Autonumber Table again. In this way, you can simply make auto number.

eg. lastno=Last number stored in the table
lastno=Val(lastno)+1

You can Save the Last Auto number using database table or using Text File.

Hello i hav tried but i can get it please can you send me a sample code

Dear All,
Plz focus on the exact problem.
When u r posting in this forum, first do give the backend u r using, table structure if possible, some sample code in front end which u r having problem with. 'll definitely help us to help u all.

regards
Shaik Akthar

Dear All,
Plz focus on the exact problem.
When u r posting in this forum, first do give the backend u r using, table structure if possible, some sample code in front end which u r having problem with. 'll definitely help us to help u all.

regards
Shaik Akthar

Rite :)

Hello i hav tried but i can get it please can you send me a sample code

Please post your sample code and Table , from that I will try the corrected code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.