Working with Auto-Incrementing field

Q

quartz

I am using Office 2003 on Windows XP.

Please note that the use of spreadsheets is per boss and user preference -
this is mandatory and beyond my control.

I have a table in which there is an auto-incrementing column that will be
used to generate a form number. Users will open a spreadsheet file that will
update this Access table with the user's network login ID - and then an
auto-incremented form number will be generated for the record.

I need to be able to retrieve that specific form number and place it into
the spreadsheet form, but with multiple users, I need to be sure of the
integrity of the form number. i.e. I can't just use MAX on the [FORM_NUMBER]
field because another user may have already generated another form. So how
can I tie a specific record to a form number?

How can I work around this issue? Thanks much for your input.
 
C

Carl Rapson

What method/code are you using to update the table with the user's ID? If
you're using DAO, you could use the recordset's .AddNew method, then fetch
the newly-generated form number by referencing that field in the recordset:

rs.AddNew
rs.Fields![user ID] = user_login_ID
new_form_number = rs.Fields![autonumber field]
rs.Update

I know something similar can be done with ADO, but I'm not familiar with the
procedure. Will this work for your situation?

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top