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

Inserting a specific number in a text field

Status
Not open for further replies.

lholgerg

Technical User
Mar 12, 2001
15
DK
I want to add a number to a record without using autonumber(because the tables are placed on a SQL server) but it should work just like autonumber. when I load the form the next available number should appear in a text field and when I add the record the next number should appear in the text box.

 
look at faq700-184 It does what you are asking - and a bit more. You could adapt it to do what you want.

Another approach would be to go ahead and create a Ms. Access table with the AuoNumber field, and then just add a record to that table, retrieve the value and use it as the Number for your SQL Server table.

You may need a GUID field instead of the AutoNumber, depending on wheather you are really "in Charge" of access tot he SQL Server db. If you use the GUID, you need to be somewhat more elaborate with the process, since you need a date/time field to be sure you have the "most recent" GUID entry and you will need to check that it really is uique to the SQL Server db.



MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top