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
| 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 Search this Thread Display Modes
  #1 (permalink)  
Old June 3rd, 2006, 01:14 PM
Authorized User
 
Join Date: May 2006
Location: Elk Grove, CA, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Combo box select affecting avail option in another

I am wanting to select an option from one combo box and then have it change the available options in another combo box?

I have created three tables Companies, Employees, and Issue.
In all three tables I have added CompanyID as a common factor.
In the Employees table I have a field called Name.
In the Issue table I have created combo box field called company name where the source is the companyname field from the companies table . In the same table I have created a combo box field called contact whereas the source is the Name field from the employees table.
What I am trying to do is create a form from the Issue table where the Company Name field and Contact field are inserted in the form however, when I select a company from the dropdown in form view of the issues table the contacts field will have a dropdown only showing me the contact from that particular company only that I can select from.
Can anyone help me with coding this? I am trying to do an SQL query an here is what I have maybe I am wrong.

Select Name
From Employees
Where Companies.companyid = Employees.companyid

I have to be missing something because it is not working. =(


EB


EB
__________________
EB
Reply With Quote
  #2 (permalink)  
Old June 3rd, 2006, 01:22 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Here is what I have done in the past...

Combo 1 is the first one you would select from.

On the OnClick event for Combo 1 have it do Combo2.Requery

For Combo 2, have the record source as a SQL Statement, but with a WHERE clause that references Combo 1.

Below is an example of 1 I did a while back.

SELECT tblSubData.SubData, tblSubData.SubDataID, tblSubData.SubDataParent FROM tblSubData INNER JOIN tblData ON tblSubData.SubDataParent = tblData.DataID WHERE (((tblSubData.SubDataParent)=[cboCombo1].[Value])) ORDER BY tblSubData.SubData;

Hope that helps - If not yell!

Mike
EchoVue.com
Reply With Quote
  #3 (permalink)  
Old June 3rd, 2006, 03:22 PM
Authorized User
 
Join Date: May 2006
Location: Elk Grove, CA, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will try that and get back to you.

thank you

eb

EB
Reply With Quote
  #4 (permalink)  
Old June 3rd, 2006, 04:33 PM
Authorized User
 
Join Date: May 2006
Location: Elk Grove, CA, USA.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, once again you have saved the day. That worked. =)

EB
Reply With Quote
  #5 (permalink)  
Old June 3rd, 2006, 05:33 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Good to hear!!

Mike
EchoVue.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Combo Box to Show Multi Column Info After Select Coby Excel VBA 0 August 14th, 2007 05:23 PM
option selected from a select box Adam H-W Classic ASP Basics 3 December 11th, 2006 11:09 AM
Select-As-You-Type Combo box? eruditus Classic ASP Components 0 May 4th, 2006 08:42 AM
dynamic upload a combo box from database on select rashmisrao JSP Basics 4 February 27th, 2006 08:41 AM
Multi Select Combo Box acdsky VB How-To 2 March 1st, 2004 03:09 PM



All times are GMT -4. The time now is 08:47 PM.


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