1. You can have the Auto-Enter Serial Number in the field definition include text. In the "next value" box put P1. Every record will then have the next numeric value prefaced with the P, eg. P1, P2, P3 and so forth.
2. Not quite sure what you are meaning by the text value changing every 18 records? Are records 19-36 meant to have the values from P2 to P37?
Make an auto-enter number field starting at 18, then your text is calculated as
"P" & Div ( aen ; 18 ) & Case ( aen > 35 ; ".," )
This should do it:
Let ( [
_count = ExecuteSQL ( "SELECT COUNT(*) FROM YourTable" ; "" ; "" )
; _n = Div ( _count - 1 ; 18 ) + 1
"P" & _n
my apologies if i did not come across clearly in my explanation of what i wanted to accomplish. what i was looking for was that records 1 thru 18 will have an auto-enter of P1; e.g., record 1 would have P1, record 2 would have P1, record 3 would have P1 until record 19 which would then begin a new value of P2. record 20 would be P2....and so on.
thx for your reply and appreciate all your thoughts on this
okramis, this looks intresting...i'll give this a try
What are you really trying to do?
Is this for printing? The page numbers will take care of themselves.
Will the data every be in some other order, some records omitted?
Sound like another instance of the XY problem.