Automate subdatasheet? (1 Viewer)

Bexus76

New member
Local time
Today, 07:54
Joined
Jun 1, 2020
Messages
2
I have a table of pipeline numbers (Field1). Each pipeline will be split into a varying number of ISO sheets (Field2).
Ex. Field1 Field2
ABCD 3
EFGH 2
Is it possible to automate the creation of a subdatasheet or connected table that concatenates the line number with an ISO sheet number based on the number from field 2? If so, how?
Ex. Field3
ABCD-1
ABCD-2
ABCD-3
EFGH-1
EFGH-2
Also, is it possible for this table to automatically update if the number from Field2 changes by adding or deleting a row?
 

June7

AWF VIP
Local time
Today, 04:54
Joined
Mar 9, 2014
Messages
5,470
Basically, no - table cannot automatically update its data. However, most anything can be done with enough code - macro and/or VBA. Maintaining this calculated value in table field would require a bunch of VBA. Access tables do not have intrinsic order - records are not added between other records (unlike inserting a row in Excel). This group sequence can be dynamically calculated in query or in textbox on report.

Deleting records should be a rare event.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:54
Joined
Oct 29, 2018
Messages
21,467
Hi. I'm not sure I follow what you mean, and it sounds like you're not supposed to do that.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:54
Joined
May 21, 2018
Messages
8,527
I think I follow and you could code this on a form to handle changes in numbersheets.

TblPipelines
--PipelineID
--PipelineName
--NumberISO_Sheets

tblISOsheets
--sheetID
--PipelineID_FK 'foreign key to tblPipelines
--SheetCounter


So ISO sheets are child records of a Pipeline.
If you create a Pipeline (pipelineID = 7), Name = ABC, numberSheets = 3.
It creates childRecords
1 7 1
2 7 2
3 7 3
I do not have to carry the parent name into the child table because you can bring it in with a query. But you now have a main record
ABC
with ISO sheet records
ABC-1
ABC-2
ABC-3

You can write code to update the number of child records when updating in the main table the "numberSheets"
 

Users who are viewing this thread

Top Bottom