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 22631.5409 (23H2) released to Release Preview
by
joep517
49 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
50 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
7 hours, 51 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
8 hours, 58 minutes ago -
0Patch, where to begin
by
cassel23
3 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
22 hours, 36 minutes ago -
89 million Steam account details just got leaked,
by
Alex5723
10 hours, 21 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
1 day, 7 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
22 hours, 7 minutes ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
9 hours, 15 minutes ago -
Installer program can’t read my registry
by
Peobody
4 hours, 13 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
19 hours, 54 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 3 hours ago -
False error message from eMClient
by
WSSebastian42
1 day, 18 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 3 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
2 days, 4 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 day, 1 hour ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
2 days, 8 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
1 day, 9 hours ago -
Outdated Laptop
by
jdamkeene
2 days, 13 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
2 days, 18 hours ago -
Another big Microsoft layoff
by
Charlie
2 days, 18 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
15 hours, 59 minutes ago -
May 2025 updates are out
by
Susan Bradley
1 hour, 32 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
3 days ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
3 days ago -
Drivers suggested via Windows Update
by
Tex265
3 days ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
20 hours, 35 minutes ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
3 days, 7 hours ago -
Apple releases 18.5
by
Susan Bradley
3 days, 1 hour 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.