Adding a new record

  • Thread starter Thread starter Larry R
  • Start date Start date
L

Larry R

I have a table that includes fields folder, and itemnum.
I would like to code a button to insert a new record that
has the same folder name as the record I am viewing, and
whose itemnum is one more than the current max for that
folder. Thanks in advance
 
-----Original Message-----
I have a table that includes fields folder, and itemnum.
I would like to code a button to insert a new record that
has the same folder name as the record I am viewing, and
whose itemnum is one more than the current max for that
folder. Thanks in advance

.
Sounds like you didn't set the itemnum field to autonumber.
You can create a new table with the exact same fields, set
the "itemnum" field to autonumber (long integer) and set
the properties of your folder field to indexed, duplicates
ok.
Now import that data from the old table into the new with
an append query.
Delete your old table and rename the new table with the
same name as the old.
Now when you add a record, the itemnum will be incremented
to the next number.

I'm assuming you have a form with an append button already
added of course.
 
Thank you for that. However, my folder field has many
different text values, and for each unique folder value, I
would like a sequence of increasing itemnums.
 
Back
Top