Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

Subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Lyon - 02 May 2005 00:08 GMT
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
Marshall Barton - 02 May 2005 00:20 GMT
>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
[quoted text clipped - 3 lines]
>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.

Signature

Marsh
MVP [MS Access]

Greg Lyon - 02 May 2005 01:05 GMT
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
Marshall Barton - 02 May 2005 01:46 GMT
>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
[quoted text clipped - 4 lines]
>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.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.