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 / General 2 / January 2008

Tip: Looking for answers? Try searching our database.

Cascading Combo Boxes in Form and Subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tia - 16 Jan 2008 01:14 GMT
I've been trying to work the bugs out of a form that has an attached subform.
I have a combo box on the main form where the user can select from a list of
Law Firms.  Based on the Law firm selected, I would like the user to be able
select related attorneys from a combo box on subform.   I would like the user
to be able to only select those attorneys related to the Law Firm selected.  
I am having a hard time figuring out how to make this work.  Jeanette
Cunningham has given me great advice on this but I haven't been able to make
it work.  Any suggestions on what I'm doing wrong?  

This is what I have in the source row of the combo box on the subform:

SELECT Timekeepers.TimekeeperID, Timekeepers.Timekeeper FROM Timekeepers
WHERE (((Timekeepers.LawFirmID)=Parent!cboLawFirmID));
John W. Vinson - 16 Jan 2008 02:29 GMT
>This is what I have in the source row of the combo box on the subform:
>
>SELECT Timekeepers.TimekeeperID, Timekeepers.Timekeeper FROM Timekeepers
>WHERE (((Timekeepers.LawFirmID)=Parent!cboLawFirmID));

You will also need one line of VBA code in cboLawFirmID's AfterUpdate event:

Private Sub cboLawFirmID_AfterUpdate()
Me!mysubformname.Form!comboboxname.Requery
End Sub

            John W. Vinson [MVP]
John W. Vinson - 16 Jan 2008 02:30 GMT
>I've been trying to work the bugs out of a form that has an attached subform.
> I have a combo box on the main form where the user can select from a list of
[quoted text clipped - 9 lines]
>SELECT Timekeepers.TimekeeperID, Timekeepers.Timekeeper FROM Timekeepers
>WHERE (((Timekeepers.LawFirmID)=Parent!cboLawFirmID));

ah... probably also the parent form's Current event needs the requery (as well
as the combo box's AfterUpdate event). Same code though.

            John W. Vinson [MVP]
 
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



©2009 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.