I'm doing development work this summer in MS Access 2.0, and part of
my project involves a many-to-many relationship which I'm displaying
using a form with an embedded subform. Everything works reasonably well...
...except, I have several command buttons which are dependent on there
actually being a join-record between the two tables, and when there isn't,
I want these buttons to be disabled.
The only way I can think of doing this is to count the number of
records in the embedded subform, like this:
recCount = Me![SubformControl].Form.RecordsetClone.RecordCount
I had half-expected Access to complain about an invalid use of
RecordCount or RecordsetClone, but no...
...half the time [and yes, it *is* selective!] Access reports "Invalid
reference to property 'Form'."
And then, the other half of the time, it doesn't complain. The main form in
question has a header to it, and I'm wondering if which part has the
focus at the time I access the subform makes a difference, but the Access
documentation/help/etc makes no mention of it. [It doesn't even mention
anything about being able to access subform properties, but I figure you
can, since whenever Access complains about the above construct, it also
chokes on references to controls on the subform as well.]
I'm at my wit's end, here, and I would really appreciate any help anyone
can give me!
Thanks in advance,
= Summer '95: Ottawa, Ontario -- Fall '95: Cambridge, Ontario =
= "Two men say they're Jesus / One of 'em must be wrong!" =
= -- Dire Straits, "Industrial Disease" =