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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Number

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How to create Auto Number for my Data Field in VB.
 

If the field is being stored in a database table you can have the table field automatically increment (in SQL Server it is an IDENTITY field, and in ACCESS it is an AUTONUMBER field) the field number and then use the @@IDENTITY (in SQL Server) to retirieve it after the INSERT.

If it is just for use in your code you will need to store the last number in a file or database table so you know the last number used. Then read the number and increment it by the interval you require.

Hope this helps.

Bryan Bosley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top