Numbering records in a continuous form

gfcaim

Registered User.
Local time
Today, 15:22
Joined
May 26, 2004
Messages
20
Sequential numbering in a continupus form based on a query - how?
 
It's possible if you have unique ordering field (SupplierId)

1) create a textbox with ControlSource:
Code:
=DCount("*";"Suppliers";"SupplierId<=Forms!Suppliers!SupplierID")

2) add that field into your query:
Code:
SELECT DCount("*","Suppliers","SupplierId<=" & T_S.SupplierID) As SeqNum, * 
FROM Suppliers T_S
or
Code:
SELECT (SELECT Sum(1) FROM Suppliers T_A WHERE T_A.SupplierId<=T_S.SupplierID) As SeqNum, * 
FROM Suppliers T_S

Last query is read-only
 
I am also having a problem with numbering. I know this is a simple question, but I cant hit upon the right answer. I have inherited a database that the employee id SHOULD HAVE BEEN an autonumber, but was not. Now, the table will not let me change to an autonumber (has many, many records and the employee id is now the primary key in other tables)...I have created a form to input the data, but I need it to automatically look at the last number in the table and put in next number in sequence.

Could you help me please? Thank you, Noreene
 

Users who are viewing this thread

Back
Top Bottom