[AccessD] Master/Detail Classes in Access

Kenneth Ismert kismert at gmail.com
Fri Mar 23 14:57:37 CDT 2012


Arthur,

Without more details, it is hard to know how to advise you.

If these forms are bound, the recordsets themselves are object
abstractions of the data. I see little point in creating an object
wrapper for a base object, if all you are going to do is simulate
functionality that the base handles perfectly well.

But if the forms are unbound, I don't know off the top of my head if
you can create multiple rows in the subform using just a collection of
generic objects. Maybe this is a recent feature. Still, you might be
better off binding the subform to a disconnected recordset, and again
use the built-in functionality to navigate.

In general terms, it sounds like you are creating unnecessary overhead.

But, I don't know the specifics, so you may well have good
justification for the extra work.

-Ken

> From: Arthur Fuller <fuller.artful at gmail.com>
> To: Access Developers discussion and problem solving <accessd at databaseadvisors.com>
> Cc:
> Date: Thu, 22 Mar 2012 15:31:19 -0400
> Subject: [AccessD] Master/Detail Classes in Access
> I've been playing with classes used to manipulate data and find that when
> administering a single table in single-record form mode, it's a cinch. But
> I cannot figure out how to handle the rows in a subform using classes. It's
> simple to create a class that mirrors the fields in the sub-table, and I'm
> guessing that I should create a collection in the master-table and populate
> it with instances of the Details class. I can do that, but then I'm not
> sure how to "navigate the collection.
>
> I've done some Googling in hopes of finding some working example of this
> approach, but so far no luck. To keep it as general as possible, let's say
> I want a traditional orders and order-details form/subform, using classes
> clsOrder and clsDetail, plonking the latter into the former's collection of
> details. Something like that. If there's a better way, I'm happy to go with
> it.
>
> Anyone have some code that does this? Or a URL to an example?
> TIA.
> --
> Arthur
> Cell: 647.710.1314



More information about the AccessD mailing list