Control not recognized

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

Guest

Why would a control not be recognized in a subform (control is in the same
subform) while open as part of the main form, but have no problems if you
only the subform by itself?

I have a field that I am trying to update in a subform based on a control in
the same subform. When I have just the subform open, everything works fine.
The problem is when I am trying to update the field in the subform, while the
form is open in the main form.
 
Here is what I have:

SELECT DISTINCT Tbl_Item.Item FROM Tbl_Item WHERE
(((Tbl_Item.ManufacturerNbr) Like
Forms!Query1subform!ManufacturerNbrControl));

The Combo box that pulls based on the above Row Source is requeried On Enter.

again, works fine when only this form is open, but isn't working when open
as a subform.
 
To refer to a control on a subform, you need to use
Forms!ParentForm!SubformControl.Form!ControlOnSubform

Replace "ParentForm" with the name of the parent form.

Replace "SubformControl" with the name of the control on the parent form
that holds the subform. (Note: This is not always the same as the name of
the form that's being used as a subform. If the subform was added to the
parent form by dragging the one form onto the other, the subform control
name should be the same as the name of the form being used as the subform.
However, if the subform was added by adding a subform control from the
toolbox and then providing the necessary information, either through the
wizard or manually, the subform control name will usually be something like
Child0)

Replace ControlOnSubform with the name of the control.

See http://www.mvps.org/access/forms/frm0031.htm at "The Access Web" for a
handy reference on this topic.
 
Back
Top