Thread: Subforms
View Single Post
  #4  
Old November 21st, 2008, 07:04 AM posted to microsoft.public.access.tablesdbdesign
Beetle
external usenet poster
 
Posts: 1,254
Default Subforms

First, just for informational purposes, when you add a form inside another
form (as a subform), it goes inside a Subform Control, which is basically
the window that holds and displays the subform. Depending on how you
add the subform, the Subform Control may, or may not, have the same name
as the subform itself. This is an important distinction because when you want
to reference a control or a value on a subform, you need to do so through
the Subform Control.

Now onto your problem. Your second combo box probably uses a form
reference in it's criteria to retrieve the value from the first combo box.
Probably something like;

"Select ThisValue From ThatTable Where ThisValue=" &
Forms![ProgramInfo]![Combo1]

This reference is valid as long as ProgramInfo is open on it's own.
However, as soon as you make it a subform inside another form the
reference will no longer work, because for Access to be able to find
ProgramInfo, it needs to first look at it's Parent form, and then the
Subform Control. So the reference would need to be modified like;

Forms![Form Global]![ProgramInfo].Form![Combo1]

The reference to [ProgramInfo] (right after [Form Global]) is a reference
to the Subform Control (not the subform itself). In this example I have
assumed that it has the same name as the subform, but remember that it
may not. In that case you would need to use the actual name of the
Subform Control in place of [ProgramInfo].
--
_________

Sean Bailey


"Mani" wrote:

For example, i've syncrhonized combo boxes in the original form (ProgramInfo
form) and it is functioning properly, but when i go to the Form Global (where
the ProgramInfo form is embedded) it is not functioning right... what i mean
by that is when i select comb 1 the combo two is not populating the correct
values.... please help....
"Beetle" wrote:

Could be that you have form references somewhere that need to be
modified now that you have placed the forms inside another form, but
it's hard to say because we don't know what you mean when you say
"not functioning properly".
--
_________

Sean Bailey


"Mani" wrote:

Hi! Sorry for my lack of terms when trying to explain my problem, but I am a
newbie. Here goes the question. I have a Main form, which is embedded with
3 subforms, When I add a subforms to the main form, for some reason, the
subforms are not functioning the same way as the its original form (i.e. The
Main Form is titled Copy of frm Global, and in the Copy of frm Global it has
Demographics subform, Services subform, and Program Inf subform ( each of
these subforms obviously was created as an individual form first) so anyways
the original forms for each is functioning properly, but when I go to the
Copy of frm Global, the subforms are not functioning properly. I hope this
makes sense.... Please help me... I run into problems right after another...