Subform not displaying information

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created 2 forms. "Quotes" will be the parent form and "Quote Details"
will be my subform. What I am trying to accomplish is to have a form similar
to an order form. I will put my customer information in the main form and
then chosse different products in my subform in order to create a quote for
my customer. I would like to use a combo box to choose the product in my
subform. After choosing the product the rest of the form would populate with
size, weights, prices, etc. which are contained in my product table. When
opening these forms in "Form View" they work fine. However, when I put my
form "Quote Details" into the Main Form (Quotes), I do not get any results
from my combo box. I have tried having my subform in both "Datasheet View"
and "Form View" but still get no results.

This is my first time creating a subform and am afraid I am missing a
crucial step. Any help would be appreciated.

Thank you,

Export Girl
 
Are you filtering the rowsource query of the combo with some control on the
subform? If so, the reference to the control on a subform would be different
than when the form is opened by itself. The problem is that a subform is
not open by itself - it is only open indirectly through the subform control
on the main form. So to reference a control on the subform,
you must also reference the subform control. With the following:

Main Form: named frmMain
subform control: named sfrmSub1
control on the subform: named txtMyControl

From a query, the correct reference to this control would be:

Forms!frmMain.form!sfrmSub1!tx­tMyControl

Note that 'sfrmSub1' must be the name of the subform control on the main
form. This is not necessarily the same as the name of the form object that
is referenced in the ControlSource of the subform control. To be sure, open
the main form and click once on the subform then check the name property
under the Other tab. Whatever you find there is what belongs in place of
sfrmSub1.
 
Sandra,

Thank you for your help. I am still struggling. To answer your question
about filtering the rowsource, I do not know. Where would I find this
information?

Also, you say from a query, the correct reference would be..... Which query
would I change?

Please help!

Export Girl

Sandra Daigle said:
Are you filtering the rowsource query of the combo with some control on the
subform? If so, the reference to the control on a subform would be different
than when the form is opened by itself. The problem is that a subform is
not open by itself - it is only open indirectly through the subform control
on the main form. So to reference a control on the subform,
you must also reference the subform control. With the following:

Main Form: named frmMain
subform control: named sfrmSub1
control on the subform: named txtMyControl

From a query, the correct reference to this control would be:

Forms!frmMain.form!sfrmSub1!tx­tMyControl

Note that 'sfrmSub1' must be the name of the subform control on the main
form. This is not necessarily the same as the name of the form object that
is referenced in the ControlSource of the subform control. To be sure, open
the main form and click once on the subform then check the name property
under the Other tab. Whatever you find there is what belongs in place of
sfrmSub1.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Export said:
I have created 2 forms. "Quotes" will be the parent form and "Quote
Details" will be my subform. What I am trying to accomplish is to
have a form similar to an order form. I will put my customer
information in the main form and then chosse different products in my
subform in order to create a quote for my customer. I would like to
use a combo box to choose the product in my subform. After choosing
the product the rest of the form would populate with size, weights,
prices, etc. which are contained in my product table. When opening
these forms in "Form View" they work fine. However, when I put my
form "Quote Details" into the Main Form (Quotes), I do not get any
results from my combo box. I have tried having my subform in both
"Datasheet View" and "Form View" but still get no results.

This is my first time creating a subform and am afraid I am missing a
crucial step. Any help would be appreciated.

Thank you,

Export Girl
 
Now when I choose the something in my combo box I get runtime error 3021.
When I click Debug, the following is highlighted in yellow:

Me.Bookmark = rs.Bookmark

Help!
 
The rowsource query of the combo - I'm just guessing that that is where the
problem is - look at the criteria row of the query (in design view). Is it
referencing a field on the form (the form which is being opened as a
subform)?

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Export said:
Sandra,

Thank you for your help. I am still struggling. To answer your question
about filtering the rowsource, I do not know. Where would I find this
information?

Also, you say from a query, the correct reference would be..... Which
query would I change?

Please help!

Export Girl

Sandra Daigle said:
Are you filtering the rowsource query of the combo with some control on
the subform? If so, the reference to the control on a subform would be
different than when the form is opened by itself. The problem is that a
subform is not open by itself - it is only open indirectly through the
subform control on the main form. So to reference a control on the
subform, you must also reference the subform control. With the following:

Main Form: named frmMain
subform control: named sfrmSub1
control on the subform: named txtMyControl

From a query, the correct reference to this control would be:

Forms!frmMain.form!sfrmSub1!tx­tMyControl

Note that 'sfrmSub1' must be the name of the subform control on the main
form. This is not necessarily the same as the name of the form object
that is referenced in the ControlSource of the subform control. To be
sure, open the main form and click once on the subform then check the
name property under the Other tab. Whatever you find there is what
belongs in place of sfrmSub1.

--
Sandra Daigle [Microsoft Access MVP]
Please post all replies to the newsgroup.


Export said:
I have created 2 forms. "Quotes" will be the parent form and "Quote
Details" will be my subform. What I am trying to accomplish is to
have a form similar to an order form. I will put my customer
information in the main form and then chosse different products in my
subform in order to create a quote for my customer. I would like to
use a combo box to choose the product in my subform. After choosing
the product the rest of the form would populate with size, weights,
prices, etc. which are contained in my product table. When opening
these forms in "Form View" they work fine. However, when I put my
form "Quote Details" into the Main Form (Quotes), I do not get any
results from my combo box. I have tried having my subform in both
"Datasheet View" and "Form View" but still get no results.

This is my first time creating a subform and am afraid I am missing a
crucial step. Any help would be appreciated.

Thank you,

Export Girl
 
You'll need to post more code - I'm guessing that this error has something
to do with the way the variable 'rs' is being set.
 
Back
Top