For starters, I'm not asking the usual question about how to link the records in a subform to the main form. I know how to do that by linking Master and Child fields. The problem I'm trying to solve is that Access won't allow split form view on a sub-form.
A scenario: Assume there are two tables, like this:
Table1 - Invoices
InvoiceNumber as String
Lots of other fields
Table2 - InvoiceLineItem s
InvoiceNumber as string
ItemNr as Long
Lots of other fields
I want to display a form that looks like this:
Desired operation:
1) Click on an invoice in the datasheet view (Area 2)
2) Corresponding invoice data appears in Area 1
3) The data from InvoiceLineItem s should appear in the subform-Datasheet
4) Click on a row in Subform-Datasheet - details should display in the Subform-FormView
I'm basically trying to emulate what would happen if Access allowed split display in a subform. To be clearer, the Invoice-Item is the same in both subforms. It's the display mode that changes.
I'm using Windows 10 and Access 2013.
Upgrading to different version of Access is not an option.
Installing any third-party add-ons is not an option
I am allowed to add code and am allowed to use system functions.
A scenario: Assume there are two tables, like this:
Table1 - Invoices
InvoiceNumber as String
Lots of other fields
Table2 - InvoiceLineItem s
InvoiceNumber as string
ItemNr as Long
Lots of other fields
I want to display a form that looks like this:
Code:
╔═══════════════════════════════╦═════════════════════════════════╗ ║ MAIN FORM - SPLIT VIEW ║ SUBFORM (SAME FORM USED TWICE ║ ║ .-------------------------. ║ .---------------------. ║ ║ | AREA 1 (form view) | ║ | SUBFORM-Datasheet | ║ ║ | InvoiceNumber | ║ | ItemNr = 1 | ║ ║ | Lots of other fields | ║ | ItemNr = 2 | ║ ║ '-------------------------' ║ '---------------------' ║ ║ .-------------------------. ║ .----------------------. ║ ║ | AREA 2 (datasheet) | ║ | SUBFORM-FormView | ║ ║ | Line 1 | ║ | Field-1 Field-2 | ║ ║ | Line 2 (etc) | ║ | Field-3 Field-4 | ║ ║ '-------------------------' ║ `----------------------' ║ ╚═══════════════════════════════╩═════════════════════════════════╝
1) Click on an invoice in the datasheet view (Area 2)
2) Corresponding invoice data appears in Area 1
3) The data from InvoiceLineItem s should appear in the subform-Datasheet
4) Click on a row in Subform-Datasheet - details should display in the Subform-FormView
I'm basically trying to emulate what would happen if Access allowed split display in a subform. To be clearer, the Invoice-Item is the same in both subforms. It's the display mode that changes.
I'm using Windows 10 and Access 2013.
Upgrading to different version of Access is not an option.
Installing any third-party add-ons is not an option
I am allowed to add code and am allowed to use system functions.
Comment