>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]