Thanks June7. Yes no sense making life so complicated in trying to have serial nos. in Sub forms. However it would help if a simple way, like in a report, is available in forms too!
Thanks June7. Yes no sense making life so complicated in trying to have serial nos. in Sub forms. However it would help if a simple way, like in a report, is available in forms too!
Bob. I tried that in the Sub Form. Like June7 said, it yields 1 in all records. Can you test this is a sub form situation?
Row numbering is not facilitated in forms because forms are often filtered/sorted by user.
Last edited by June7; 05-26-2020 at 07:02 PM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
AutoNumberSomehow the couple of videos I saw on creation suggested to add the Sub form in the Footer of the main form. I am using it as suggested in the Detail of them Master form.
Serial Number of Sub Form
Assume there are 8 items in the Subform. I want a column to indicate the Serial number say 1 to 8.
Q1 - how does one go about it? Do we add a text field in the Subform? How does it auto-generated? The Serial No should be reset to start from 1 for each header record (which in my case is the Sales Order!)
Q2 - If I delete a record in the sub Form, the Serial no should reset. So if I delete serial no 4 of sub form, Sr 5 to 8 will be renumbered as 4 to 7
----------------
Purpose: Use an AutoNumber field to provide a unique value that serves no other purpose than to make each record unique. The most common use for an AutoNumber field is as a primary key.
Autonumbers--What they are NOT and What They Are
Microsoft Access Tables: Primary Key Tips and Techniques
Relational Database Primary Keys
Use Autonumbers properly
Every table I create has an Autonumber type field.
If you have a (Serial Number) number that must be consecutive, you will have to write your own code to manipulate the number.
So the answer to Q2 is you'll have to write code to keep the numbers consecutive.