Setting "As Control" for Nested Subforms

W

wrldruler

I've got a series of nested sub-forms:

(1a) Main Parent
(1b) Sub-form: Header of calendar -- Months, Days of Week, etc.
(1c) Continuous Sub-form: Displays employee vacations

I need to iterate through the sub-form name ("subfrm_Vacations_January,
subfrm_Vacations_February, ...", reference a nested subform with a
constant name ("subfrm_Vacation_Details"), and then iterate through a
bunch of Listboxes on the nested subform (List_01, List_02....)

I can reach the sub-form via:
Set cntrl_Month = Me("subfrm_Vacations_" & Month_Name)

I can reach the Listboxes via:
Set cntrl_Listbox = subfrm_Vacation_Details("List" & strNum)

But I can't figure out how to put the two together. I want to do
something like:

cntrl_Listbox = cntrl_Month.subfrm_Vacation_Details("List" & strNum)

Thanks
 
D

Douglas J. Steele

Try

Set cntrl_Month = Me("subfrm_Vacations_" & Month_Name)
Set cntrl_Listbox = cntrl_Month.Form("List" & strNum)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top