numbered lists

J

jax

I have created a data base with a large amount of information for cross
referencing purposes. It mostly consists of lots of queries. Each query is
a list of items, recipients and suppliers. With Access 2003 I was able to
number each item in a query by simply starting from 1 and arrowing down the
page - it filled the numbers in series automatically. With Access 2007 this
does not happen. This is a crucial part of my data base; each item must be
numbered and these numbers sometimes change as the lists are modified. How
can I do this quickly and simply with Access 2007? So far I have had to
revert to Office 2003.
For example in the "Cabins" query:

number Item Recipient Supplier
1 cabin Theatre tent The Cabin Company.
2 cabin Dance stage The Cabin Company
3 cabin Main stage The Cabin Company
etc etc...
 
A

Allen Browne

Create a form bound to your table.
You can show it in datasheet view if you want it to look like a table.

Use the BeforeInsert event procedure of the form to assign the next
available number. This kind of thing

Private Sub Form_BeforeInsert(Cancel As Integer)
Me.[number] = Nz(DMax("[number]", "Table1"),0) + 1
End Sub

Microsoft removed this 'feature' from Access 2007 in response to feedback
from lots of people who felt it was inappropriate for a database table to
behave this way. (Many of us were really glad they listened to us.)

(Hopefully you don't really have a field named 'number'.
That's a reserved word, and may cause you grief.)
 

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