How to display record number in order in text field?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wish to display record number in order that I have created in the form. For
example, if I create 1 client detail then the number one will be displayed in
a text field named "ClientNo". If I create client number 2 then the number 2
appears in the text field "ClientNo.
 
from Rainbow01 Hong Kong

i never use this method, but u can try try
in your text box "ClientNo" 's RecordSource:
=Me.Recordset.RecordCount

"Hue Tran" 來函:
 
That will not work. It will show how many records are in the table or query,
but will not be consistant. Record numbers are really meaningless.
Depending on the sorting and/or filtering in place, the record number will
change for a specific record. The record number, which is not RecordCount,
but AbsolutePosition, only shows the position of the record in the current
recordset.

If what you are trying to do is to assign a sequential number to your
clients, then you can use a technique like this when you add a new client to
give it the next number:

Me.txtClientId = Nz(DMax("[CliendID]", "ClientTable"),0) + 1
 
Back
Top