General discussion

Locked

Access Programming

By Sprocket ·
In my access database I have a form with a subform.
This subform is used to enter multiple lines of data and ofcourse is all stored in various tables.

I want each line in my subform to show an item number, starting at 1 and increasing by 1 each line and the item number to be stored for later use in my tables.

When a new form is started, I need the item number in the subform to always start at one.

This is probably easy, and i have done it in the past, but am mentally blocked today.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by sivasankaran In reply to Access Programming

you have to create the tables with main table as primary key say anum(autonumber) and the sub table as same field (anum as long number ) but should allow duplicates. in the relationships make it one to many . now using the wizard you can make a form and subform with multiple records. but anum will auto increment so in the sub table create a field storing the count of anum. at evry new record event on form put count anum +1 to new field say sno so for first rec dcount (anum, tablename) = 0 +1 =1 and so on .

Collapse -

by Sprocket In reply to

Poster rated this answer.

Collapse -

by Sprocket In reply to Access Programming

This question was closed by the author

Back to Software Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums