Auto-Line-Numbering

G

Guest

Hi,
I am trying to build a front-end for an existng Purchase Order (PO) SQL
database. The problem i am having is the line-numbering for the items
purchased on the PO.

Currently the database has 2 tables, [mmpohd] for the PO Header information
and a table [mmpodt] for the lines of the PO or the items to be purchased on
the PO. (one record for each item purchased)

On the table mmpodt (for the PO lines) the current form has the user putting
the line-numbers manually which is causing problems for people who do not
follow the prescribed pattern of line number 001, 002, 003, etc. We have
other reports and queries that depend on the line numbers being in that
format.

So i want the new form i am building to autmatically assign these numbers
for each new line that is put into the database. I have been playing around
with the 'dmax' statement and no luck.

Any assistance on this would be greatly, greatly appreciated!!!!

As always THANKS IN ADVANCE!!!!
Chip
 
K

Keith Wilby

Chip said:
So i want the new form i am building to autmatically assign these numbers
for each new line that is put into the database. I have been playing
around
with the 'dmax' statement and no luck.

This as the default value of the pertinent text box should work:

Nz(DMax("MyField","tblMyTable"),0)+1

Keith.
www.keithwilby.com
 

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