Subform

  • Thread starter Thread starter Greg Lyon via AccessMonster.com
  • Start date Start date
G

Greg Lyon via AccessMonster.com

I have a main from with a subform on it. I'm trying to populate the
subform with fields related to the drop-down on the main form. On the main
form is a drop down for company. When I click and choose a company, I
would like the subform to populate with fields only pertaining to that
company. Is this possible? If not, what is the best way to accomplish
this? I'm thinking that I would have to create a separate subform for each
company. Yuk!

Thanks,
Greg Lyon
 
Greg said:
I have a main from with a subform on it. I'm trying to populate the
subform with fields related to the drop-down on the main form. On the main
form is a drop down for company. When I click and choose a company, I
would like the subform to populate with fields only pertaining to that
company. Is this possible? If not, what is the best way to accomplish
this? I'm thinking that I would have to create a separate subform for each
company. Yuk!


Make sure the combo box has its BoundColumn set to the
company table's primary key field. Then set the subform
control's Link Master property to the combo box and the Link
Child proerty to the same prinmary key field.
 
I tried this but I get an error saying the espression is too complex. The
subform is blank. The drop-down is combo3. I placed combo3 as the Master
and companyid as the child. In the combo3 drop-down, I put the companyid
as the bound field.
What am I doing wrong?

The companyid is not unique. There may be 3-4 records with the same
company id that I am trying to capture in the subform.

Thanks,
Greg
 
Greg said:
I tried this but I get an error saying the espression is too complex. The
subform is blank. The drop-down is combo3. I placed combo3 as the Master
and companyid as the child. In the combo3 drop-down, I put the companyid
as the bound field.
What am I doing wrong?

The companyid is not unique. There may be 3-4 records with the same
company id that I am trying to capture in the subform.


Uniqueness doesn't matter.

Double check the combo box's properties. I think they
should be something like:

RowSource: SELECT CompanyID, CompanyName
FROM Companies
ORDER BY CompanyName
ColumnCount: 2
ColumnWidths: 0;
BoundColumn: 1

although you may, or may not, have more columns than the two
critical ones I listed. Just be sure the ColumnCount is the
same as the number of fields in the query.

The only other thing I can think of that might cause trouble
is if CompanyID is not the real name of the field in the
table or combo3 is not the name of the combo box.
 
Back
Top