PC Review


Reply
Thread Tools Rate Thread

Cascading Combo Boxes in Form and Subform

 
 
Tia
Guest
Posts: n/a
 
      16th Jan 2008
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));


 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      16th Jan 2008
On Tue, 15 Jan 2008 17:14:02 -0800, Tia <(E-Mail Removed)> wrote:

>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]
 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      16th Jan 2008
On Tue, 15 Jan 2008 17:14:02 -0800, Tia <(E-Mail Removed)> wrote:

>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));
>


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]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cascading combo boxes in a subform Names Microsoft Access 5 13th May 2008 02:05 AM
Cascading combo boxes on a subform =?Utf-8?B?U3R1?= Microsoft Access Forms 2 21st Nov 2005 07:36 PM
cascading combo boxes on a subform question Alex Anderson Microsoft Access Forms 17 18th Dec 2004 01:36 AM
Cascading combo boxes on continuous subform Lynn Microsoft Access ADP SQL Server 1 29th Jan 2004 09:50 PM
Cascading Combo Boxes In A Subform Wizcow Microsoft Access Forms 1 15th Oct 2003 05:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 AM.