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 Programming / April 2005

Tip: Looking for answers? Try searching our database.

How do I create a subform programmatically?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Scarlett - 08 Apr 2005 15:09 GMT
I need to create a sub form in code - depending on data displayed in my main
form. I'm new to Access and VB
John Vinson - 08 Apr 2005 18:51 GMT
>I need to create a sub form in code - depending on data displayed in my main
>form. I'm new to Access and VB

Why?

Normally you would have a pretty much static set of forms; the data
displayed in the forms will vary, but creating new forms and new
controls is complex, time-consuming, and usually unnecessary.

What would be the purpose of this new subform? Can you instead have
subforms already created, perhaps on the pages of a Tab control?
What's the context?

                 John W. Vinson[MVP]    
Jim Scarlett - 09 Apr 2005 15:57 GMT
Hi John - Thanks for your interest! As you can tell I'm very new to Access
(work on AS400) but am OK with relational databases. I have a search 'Form'
containing 3 combos: Company, Job and Person. Users can select an entry from
any *one* of these and depending on which of them is selected a different
Form/SubForm combination is required. I'm using a stored Procedure to select
the appropriate records to display in each case. It's also important that the
'Search' screen (with the 3 combos) be available and visible throughout the
session.
I can correctly set the parameterfor the stored procedure but i'm not sure
how to associate this with the Form/Subform
Thanks,
jim

> >I need to create a sub form in code - depending on data displayed in my main
> >form. I'm new to Access and VB
[quoted text clipped - 10 lines]
>
>                   John W. Vinson[MVP]    
John Vinson - 09 Apr 2005 16:35 GMT
>Hi John - Thanks for your interest! As you can tell I'm very new to Access
>(work on AS400) but am OK with relational databases. I have a search 'Form'
[quoted text clipped - 6 lines]
>I can correctly set the parameterfor the stored procedure but i'm not sure
>how to associate this with the Form/Subform

I'd suggest having three subforms, one for each case, on your form;
set their Visible property to False so they won't be seen.

In the AfterUpdate event of each combo, set the appropriate Subform
back to visibility.

                 John W. Vinson[MVP]    
 
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



©2008 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.