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, 2 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
-
Windows 11 Insider Preview build 27871 released to Canary
by
joep517
12 hours, 17 minutes ago -
Windows 11 ad from Campaign Manager in Windows 10
by
Jim McKenna
9 hours, 38 minutes ago -
Small desktops
by
Susan Bradley
2 hours, 30 minutes ago -
Totally disable Bitlocker
by
CWBillow
10 hours, 39 minutes ago -
Phishers extract Millions from HMRC accounts..
by
Microfix
9 hours, 54 minutes ago -
Windows 10 22H2 Update today (5 June) says up-to-date but last was 2025-04
by
Alan_uk
1 day, 16 hours ago -
Thoughts on Malwarebytes Scam Guard for Mobile?
by
opti1
9 hours, 50 minutes ago -
Mystical Desktop
by
CWBillow
1 day, 19 hours ago -
Meta and Yandex secretly tracked billions of Android users
by
Alex5723
1 day ago -
MS-DEFCON 2: Do you need that update?
by
Susan Bradley
11 hours, 28 minutes ago -
CD/DVD drive is no longer recognized
by
WSCape Sand
2 days, 10 hours ago -
Windows 11 24H2 Default Apps stuck on Edge and Adobe Photoshop
by
MikeBravo
2 days, 13 hours ago -
North Face and Cartier customer data stolen in cyber attacks
by
Alex5723
2 days, 11 hours ago -
What is wrong with simple approach?
by
WSSpoke36
9 hours, 45 minutes ago -
Microsoft-Backed Builder.ai Set for Bankruptcy After Cash Seized
by
Alex5723
2 days, 23 hours ago -
Location, location, location
by
Susan Bradley
1 day, 13 hours ago -
Cannot get a task to run a restore point
by
CWBillow
3 days ago -
Frustrating search behavior with Outlook
by
MrJimPhelps
2 days, 15 hours ago -
June 2025 Office non-Security Updates
by
PKCano
3 days, 11 hours ago -
Secure Boot Update Fails after KB5058405 Installed
by
SteveIT
1 day, 13 hours ago -
Firefox Red Panda Fun Stuff
by
Lars220
3 days, 11 hours ago -
How start headers and page numbers on page 3?
by
Davidhs
3 days, 21 hours ago -
Attack on LexisNexis Risk Solutions exposes data on 300k +
by
Nibbled To Death By Ducks
3 days ago -
Windows 11 Insider Preview build 26200.5622 released to DEV
by
joep517
4 days, 6 hours ago -
Windows 11 Insider Preview build 26120.4230 (24H2) released to BETA
by
joep517
4 days, 6 hours ago -
MS Excel 2019 Now Prompts to Back Up With OneDrive
by
lmacri
3 days, 20 hours ago -
Firefox 139
by
Charlie
3 days, 12 hours ago -
Who knows what?
by
Will Fastie
2 days, 14 hours ago -
My top ten underappreciated features in Office
by
Peter Deegan
17 hours, 33 minutes ago -
WAU Manager — It’s your computer, you are in charge!
by
Deanna McElveen
3 hours, 27 minutes 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.