Making serial without using primary key or Auto number Field

  • Thread starter Thread starter Ken Snell
  • Start date Start date
K

Ken Snell

Simple generic format:

SerialValue = Nz(DMax("Serial Expression", "TableName"), 0) + 1
 
Thank you very much for your help and answer
Is There any way to make Serial for records without using (AutoNumber Field
as PK) for example
StudentName ,Class, School, Degree
Serial Expression StudentName Class School Degree
1 a 2 sd 12
2 b 3 sdf 25
3 c 7 sdf 54
4 cd 8 sd 15
5 etc
I don’t want to make serial depending on the primary key.. or Autonumber
Field
Thank you very much for your help and answer
 
Thank you very much for your help and answer...
Where can i put this code?

I want to tell you That Serial Expression not a field in my table The
Serial Expression here is the code you give me
and in my example i'm using a query as ouput of my records ..
(Serial Expression) StudentName Class School Degree
1 a 2 sd 12
2 b 3 sdf 25
3 c 7 sdf 54
4 cd 8 sd 15
5 etc

Thank you very much for your help and answer...
 
OK - how do you want to use this code? in a form? in a report? in a query?

You'll need to have a field in your table in order to store the serial
number if you want to keep it with the records; if you just want it for
display, then what I posted may need to be done differently. More info,
please.
 
Mr. Ken Snell [MVP]
Thank you very much for your help and answer:
1- I want to using This Code in Query .
2- I don't know how to make a field in a table in order to store the serial
number to keep it with the records. (not enter seiral manual)
3- I don't want to use Autonumber Field to make serial Because I have an
expression i'm using Autonumber Field
I'm using This in query:
Dcount ("*";"Tablename";"PK>= "&[PK])
This code make a trouble when sorting records (the sort order only by using
Autonumber Field =PK)
I hope you can understand me.

****************************************************************************
**********
 
Let me back up a minute here. Is your purpose for the serial number value to
be as a display only? (such as to show the "rank" or "record number"?) Or
are you wanting to store this value in the table and use it in queries for
sorting purposes?
--
Ken Snell
<MS ACCESS MVP>


1 said:
Mr. Ken Snell [MVP]
Thank you very much for your help and answer:
1- I want to using This Code in Query .
2- I don't know how to make a field in a table in order to store the serial
number to keep it with the records. (not enter seiral manual)
3- I don't want to use Autonumber Field to make serial Because I have an
expression i'm using Autonumber Field
I'm using This in query:
Dcount ("*";"Tablename";"PK>= "&[PK])
This code make a trouble when sorting records (the sort order only by using
Autonumber Field =PK)
I hope you can understand me.

****************************************************************************
**********
 
Back
Top