Auto assign the primary key

  • Thread starter Thread starter Patti
  • Start date Start date
P

Patti

Hi!

I apologize if this has been asked recently -- I haven't
had any luck with the search function.

I'm creating a data entry form that feeds a table, tblPO.
The first field in the table, Record, is the primary key.
I'd like the form to assign the next available number.

How do I do this?

Thanks!
 
Create a new table that's identical to tblPO, except make Record an
Autonumber field, not a numeric one.

Write a query to append all of the existing data in tblPO to the new table.
The next row you enter will have Record one greater than the highest number
used so far.

Note, though, that Autonumbers are not guaranteed not to have gaps in them.
If it's important that you have consecutively numbered values, you may want
to reconsider using an Autonumber.
 

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

Back
Top