Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

ACCESS : Form and SubForm

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
etienne.marchand@gmail.com - 06 Jul 2007 18:05 GMT
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,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.