D
dp724
I have a form called AddTransaction based on a table called tbl_Transaction.
The table has three fields TransactionID(PK/autonumber), TransactionNo(#),
ProjectID(#), among others. I want the TransactionNo field to record new
transactions, starting from number 1, based on the ProjectID. So when I add a
transaction it assigns the next sequential number, for it’s ProjectID. If a
new ProjectID is added, the TransactionNo should start with number 1. The
TransactionNo for each ProjectID starts with 1.
I’ve tried using the macro below, which I adapted from another posting (
http://www.accessmonster.com/Uwe/Forum.aspx/access-macros/5859/auto-numbering-of-a-kind
), but nothing happens. No number appears on the table.
Nz(DMax("[TransactionNo]","Tbl_Transactions","[ProjectID] ='&[ProjectID]&'"),
0)+1
Would greatly appreciate any help.
Dave
The table has three fields TransactionID(PK/autonumber), TransactionNo(#),
ProjectID(#), among others. I want the TransactionNo field to record new
transactions, starting from number 1, based on the ProjectID. So when I add a
transaction it assigns the next sequential number, for it’s ProjectID. If a
new ProjectID is added, the TransactionNo should start with number 1. The
TransactionNo for each ProjectID starts with 1.
I’ve tried using the macro below, which I adapted from another posting (
http://www.accessmonster.com/Uwe/Forum.aspx/access-macros/5859/auto-numbering-of-a-kind
), but nothing happens. No number appears on the table.
Nz(DMax("[TransactionNo]","Tbl_Transactions","[ProjectID] ='&[ProjectID]&'"),
0)+1
Would greatly appreciate any help.
Dave