Forms and Subforms Problems

  • Thread starter Thread starter DEvans
  • Start date Start date
D

DEvans

I have created a from that has a field that is used to
restrict the possible choices for another field. I did
this by creating a query and had the criteria for the
query be the field from the form. This works fine
individually, but when I place that form as a subform
(which is reallywhat I want ot be able to do, the restrict
query does not recognize the criteria line where I am
calling the field from the form.

It cannot seem to find the field on the form (when used as
a subform) to make the query work. Is there a work around
so I can do what I want

Thanks
 
The subform is not open in its own right - i.e. it is not part of the Forms
collection - and so the reference to Forms!... does not work.

You could use:
[Forms]![NameOfMainFormHere].[Form]![NameOfSubformHere]![NameOfCombo]

Howver, it might be better to use the AfterUpdate event procedure of the
first combo to set the RowSource of the 2nd. Details in article:
Limit content of combo/list boxes
at:
http://www.mvps.org/access/forms/frm0028.htm
 
Back
Top