Hello,
I have a Form, which includes a SubForm
I would like to use a condition to allow the access to the subform
(whatever the method).
The condition is defined by a field of the Form, and the result of a
Query (that I can execute with a macro)
How can I achieve that ?
Thanks,
Klatuu - 06 Jul 2007 19:42 GMT
Is a query actually the best way to do this?
Can you be a bit more specific about what you are doing? In most cases, a
Domain Aggragate function is a better choice.

Signature
Dave Hargis, Microsoft Access MVP
> Hello,
>
[quoted text clipped - 8 lines]
>
> Thanks,
kingston - 06 Jul 2007 20:06 GMT
Create a procedure in the main form to enable the subform and another to
disable the subform. Open the form in design mode and right-click on the
title bar to Build Event... and select Code. Insert a procedure, name it
EnableSub, choose Sub, and choose Public. The code that goes in this
procedure would look something like:
Forms!MainForm.SubForm.Enabled = True
DisableSub would similarly be:
Forms!MainForm.SubForm.Enabled = False
Now you can use this in your macro. You can also use the conditional field's
AfterUpdate event to check and enable/disable the subform.
>Hello,
>
[quoted text clipped - 8 lines]
>
>Thanks,