Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2005, 05:10 PM
Authorized User
 
Join Date: Jul 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rocknrisk
Default ComboBox with Data from More than 1 Table

Hi all,

How do I get data from 2 tables into 1 ComboBox. Probably simple but I cannot work it out. My theoretical knowledge says create a Query, then populate the ComboBox using the Query as the RecordSource.

(tblContacts.chrSurname & ", " & tblContacts.chrFirstName) AND (tblEmployees.chrSurname & ", " & tblEmployees.chrFirstName)

so... ComboBox LIST =

Marley, Bob Contact
Moore, Gary Employee
Rock, Kid Contact
Osbourne, Ozzy Employee (the bloody people working for us ;o))
Vedder, Eddie Contact

Any help is greatly appreciated.

Clinton.
 
Old August 12th, 2005, 05:28 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey Clinton,
What are you going to do with the data after selection?

Kevin

dartcoach
 
Old August 12th, 2005, 05:40 PM
Authorized User
 
Join Date: Jul 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rocknrisk
Default

Hey Kevin... How's it going, mate?

For the Call DB... Contacts call, but so can employees (to pass info to the rest of the team)... I'm hoping to create report that staff members can run at the beginning of their shift to get up to speed with any current issues)... I see your thinking now... yes, this all gets placed in mtblCalls with lngzContactID = mtblContacts.idsContactID... hmmmmmmm??? What to do? I now know my devil, but he's bigger.

Clinton
 
Old August 12th, 2005, 05:47 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Clinton,
So, when you pull the info from both tables, you also need the contact id from the contact table whether they are a contact or an employee right?
How many people will be using this and how often?

Kevin
P.S. If you want to go to straight email let me know.


dartcoach
 
Old August 12th, 2005, 05:58 PM
Authorized User
 
Join Date: Jul 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rocknrisk
Default

Kevin,

Yes, that's correct. Up to 400 people using it for 37.5 hours a week. In shift patterns. I'd work on about 300 at peak time. But the Employees calling in will only be up to 12 max (the Support Team). I'm wondering if it wouldn't just be easier to add the Support Team into mtblContacts. I have a Notes MemoBox so can just add a note "This person is an employee"... What do you think? Easy option or Expandability... I have other ideas for future use of the Call DB for communication amongst Advisors, Support Staff, and Customers (via internet)... to report, record and publish Tech Issues...

Cheers for your help again. I'm happy, here or email...

Clinton
 
Old August 18th, 2005, 07:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Clinton, here is an example where I select first names from two tables to populate the rowsource of a second combobox based on the choice of a first combobox. It uses a UNION query.

Me.cboFirstName.RowSource = "SELECT DISTINCT [strFirstName] FROM tblPSMTeam WHERE [strLastName] = '" & Trim(Me.cboLastName) & "' UNION SELECT DISTINCT [strNameF] as strFirstName FROM tblAQDStaff WHERE [strNameL] = '" & Trim(Me.cboLastName) & "' ORDER BY [strFirstName];"


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old August 19th, 2005, 02:30 AM
Authorized User
 
Join Date: Jul 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rocknrisk
Default

Hi Greg,

Cheers. That works great. many thanks.

Clinton
 
Old August 19th, 2005, 02:34 AM
Authorized User
 
Join Date: Jul 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rocknrisk
Default

Hi Greg,

... but as Kevin pointed out earlier, I have an issue passing the data back to the correct table... Cheers though... I am using that UNION QUERY elsewhere... so still great info... Nice one...

Clinton





Similar Threads
Thread Thread Starter Forum Replies Last Post
Making ComboBox to display the List from DB table Bjay VB Databases Basics 1 August 1st, 2007 05:55 PM
Table rendering with table & comboBox pazzuzu Java GUI 0 May 9th, 2007 09:04 AM
Data in combobox sathishr Excel VBA 1 January 2nd, 2007 06:35 AM
Restricting the data in a ComboBox hemanth_p2p Visual Basic 2005 Basics 2 January 10th, 2006 02:23 AM
data binding a combobox ozPATT Excel VBA 1 November 16th, 2005 08:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.