I am developing a user form on a access data base and would like to to have a combo box with a list of things to be picked. I can set the list up with in the properties, but I was wondering how I could use a table and the combo box would just reference the table. Any tips on how this can be done?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Setting up a combox using a table for list (Access 07)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Setting up a combox using a table for list (Access 07)
- This topic has 20 replies, 2 voices, and was last updated 17 years, 3 months ago.
AuthorTopicWSbluerayz
AskWoody LoungerMarch 11, 2008 at 10:14 pm #449360Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody Lounger -
WSbluerayz
AskWoody Lounger -
WSbluerayz
AskWoody LoungerMarch 13, 2008 at 4:46 pm #1101799What I am exactly after is setting the row source to a table, called customer and I query all in the field called Company. The next combo box is where I am having trouble. I would like to query only Company Reps names from Customer table where the company name is = to the company selected in the first combo box.
Hopefully this makes sense.
Thanks Ahead
-
WSHansV
AskWoody LoungerMarch 13, 2008 at 5:02 pm #1101800 -
WSbluerayz
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSbluerayz
AskWoody LoungerMarch 13, 2008 at 6:30 pm #1101813 -
WSHansV
AskWoody Lounger -
WSbluerayz
AskWoody LoungerMarch 13, 2008 at 6:46 pm #1101817Thank you for the tip. I am almost of fto the races having the event procedure not stop on anything.
although nothing is showing up in the 2nd combobox I goto the vb scipt editor an stop the code to view the varibles and it seems to be grabbing the primay key value from the first combobox pick?
-
WSHansV
AskWoody Lounger -
WSbluerayz
AskWoody LoungerMarch 13, 2008 at 7:59 pm #1101826I think my problem is when following the instructions on the MSDN link you have attached to the post. I do not know how to do the step:
An Access 2007 database exists which contains two tables, tblCategories and tblProducts. The Category field in tblProducts is a lookup column that is linked to the Category field in the tblCategories table.
Does this matter?
-
WSHansV
AskWoody Lounger -
WSbluerayz
AskWoody LoungerMarch 13, 2008 at 11:08 pm #1101872Sure,
What I have setup is Two Tables,
tblContact
tblRequest_ContacttblContact Is a table that Stores customer details ex. Company, Company Rep, Street Address ect. for lists
TblRequest_Contact is a table that will store jobs.
I have created a Job fill out form that so far has 2 comboboxes and a text box.
Combobox 1 is for picking a Company, which I want connect to the tblContact Company field to get a list and only List the unique companys so no multiples. The use will pick a company from the list and populate the Company field in tblRequest_Contact (Currently I have this working)
Combobox2 is a Company Rep, Which I want to syncronize with the company combobox, so which ever company is picked then the list will show only customer reps belonging to the Company pick in the combobox list. I believe a query is needed that looks at the Combobox1 value and select only company reps that belong to that company.
The Textbox is for An Address which again is a query, that reports multiple fields from the tblContact
Street Address, Postal Code, Province, Country -
WSHansV
AskWoody LoungerMarch 13, 2008 at 11:17 pm #1101874Since a company can have multiple reps (I assume
), you should have a table tblCompany that lists the companies. Each company will have a unique CompanyID (autonumber), plus a CompanyName and other information relevant to the company.
The table tblContact contains a unique ContactID (autonumber), plus CompanyID (number, long integer) to link to tblCompany, plus ContactName and other information relevant to the contact.
The first combo box will have a query based on tblCompany as Row Source, and the second combo box will have a query based on tblContact as Row Source.
Both combo boxes have two columns, of which the first (which contains the unique key) will be hidden because its column width is set to 0. So the user selects a name, but the value of the combo box will be the corresponding ID.
When the user selects a company in the first combo box, the After Update event procedure changes the SQL of the Row Source of the second combo box to return only contacts whose CompanyID equals the value of the first combo box. -
WSbluerayz
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSbluerayz
AskWoody LoungerMarch 13, 2008 at 11:56 pm #1101886Ok thank-you. So I have setup my Tables this way. as for the SQL statment behind combobox1:
Option Compare DatabasePrivate Sub cboCompany_AfterUpdate()
‘ Update the row source of the cboProducts combo box
‘ when the user makes a selection in the cboCategories
‘ combo box.
Me.cboCompanyRep.RowSource = “SELECT [Company Rep] FROM” & _
” tblContact WHERE CompanyID = ” & _
Me.cboCompany & _
” ORDER BY [Company Rep]”Me.cboCompanyRep = Me.cboCompanyRep.ItemData(0)
End SubThis doesnt seem to work anysuggestions?
-
WSHansV
AskWoody LoungerMarch 14, 2008 at 12:03 am #1101887Could you post a stripped down copy of your database? See post 401925 for instructions.
Note: the database should be an .mdb, not an .accdb file, most Loungers (including me) don’t have Access 2007 yet, so they can’t open an .accdb.
-
WSbluerayz
AskWoody Lounger -
WSHansV
AskWoody Lounger
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Intel Management Engine (Intel ME) Security Issue
by
PL1
2 hours, 25 minutes ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
35 minutes ago -
National scam day
by
Susan Bradley
2 hours, 37 minutes ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
19 hours, 57 minutes ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
21 hours, 17 minutes ago -
Tools to support internet discussions
by
Kathy Stevens
1 day, 4 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
12 hours, 23 minutes ago -
AI is good sometimes
by
Susan Bradley
1 day, 4 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
18 hours, 32 minutes ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
2 days, 4 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
2 days, 3 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
2 days, 7 hours ago -
Excessive security alerts
by
WSSebastian42
22 hours, 8 minutes ago -
* CrystalDiskMark may shorten SSD/USB Memory life
by
Alex5723
2 days, 16 hours ago -
Ben’s excellent adventure with Linux
by
Ben Myers
9 hours, 57 minutes ago -
Seconds are back in Windows 10!
by
Susan Bradley
2 days, 3 hours ago -
WebBrowserPassView — Take inventory of your stored passwords
by
Deanna McElveen
21 hours, 35 minutes ago -
OS news from WWDC 2025
by
Will Fastie
7 hours, 41 minutes ago -
Need help with graphics…
by
WSBatBytes
1 day, 12 hours ago -
AMD : Out of Bounds (OOB) read vulnerability in TPM 2.0 CVE-2025-2884
by
Alex5723
3 days, 8 hours ago -
Totally remove or disable BitLocker
by
CWBillow
2 days, 7 hours ago -
Windows 10 gets 6 years of ESU?
by
n0ads
2 days, 10 hours ago -
Apple, Google stores still offer China-based VPNs, report says
by
Nibbled To Death By Ducks
3 days, 19 hours ago -
Search Forums only bring up my posts?
by
Deo
7 minutes ago -
Windows Spotlight broken on Enterprise and Pro for Workstations?
by
steeviebops
4 days, 6 hours ago -
Denmark wants to dump Microsoft for Linux + LibreOffice
by
Alex5723
10 hours, 54 minutes ago -
How to get Microsoft Defender to honor Group Policy Setting
by
Ralph
3 hours, 54 minutes ago -
Apple : Paragon’s iOS Mercenary Spyware Finds Journalists Target
by
Alex5723
4 days, 17 hours ago -
Music : The Rose Room – It’s Been A Long, Long Time album
by
Alex5723
4 days, 18 hours ago -
Disengage Bitlocker
by
CWBillow
4 days, 8 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.