Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 10th, 2004, 07:50 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default Populate List Box by Combo Box Selection

Hi,

   I know this must have been covered a thousand times... I have three tables: tblMain, tblJurisdiction, tblBuilding. The tblMain has a look up to tblJurisdiction, and a look up to tblBuilding. tblBuilding also has a look up to tblJurisdiciton since we have several Jurisdictions, and within those Jurisdictions there are several Buildings each. Perhaps tblMain only needs to look up tblBuilding since the Jurisdiction issue will be covered through the tblBuilding look up to tblJurisdiction.

   I have a form that uses tblMain, and I would like users to be able to select a Jurisdiction in a combo box (no problem there) and then based on the Jurisdiction they selected, have a limited selection in a list box of Buildings in that Jurisdiction. They should be able to select more than one Building.

   Thanks in advance...

mmcdonal

mmcdonal
__________________
mmcdonal

Look it up at: http://wrox.books24x7.com
Reply With Quote
  #2 (permalink)  
Old May 10th, 2004, 06:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have the RowSource for your Building based on the Jurisdiction Combobox, and requery it when Building is changed.
For example, on the AfterUpdate event of the Jurisdiction Combobox (named cJurisdiction here)
Code:
Me.cBuilding.RowSource = "SELECT * FROM tblBuilding WHERE JurisdictionID = " & Me.cJurisdiction
Me.cBuilding.Requery
There's more elegant ways to do it, but that's the best way I can describe it using code only, and at this time of the day

Steven

I am a loud man with a very large hat. This means I am in charge
Reply With Quote
  #3 (permalink)  
Old June 15th, 2004, 12:08 PM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,102
Thanks: 0
Thanked 2 Times in 2 Posts
Default

This was a clear and direct answer to your question. If you don't understand it- that doesn't make it vauge.


Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a text box from a combo box value dnf999 Access VBA 7 February 6th, 2012 01:24 PM
Combo Box -1 Selection Little Shell VB.NET 2002/2003 Basics 5 June 14th, 2005 06:16 PM
Populate a combo box from database w/vbscript morituri VBScript 1 March 1st, 2005 06:06 PM
Populate Combo Box phil.t Access 3 November 18th, 2004 02:39 AM
Populate combo box with access db with using ADO neo_jakey Beginning VB 6 1 September 28th, 2004 02:07 AM



All times are GMT -4. The time now is 05:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.