Combobox question

Noclueforid

New Member
Joined
Jul 24, 2014
Messages
2
Hello!

I have a table that will track projects. Each project can have many sub-projects, so i created a table to track those and created a relationship between them. Each sub-project will have many different vendors that will be used, so I created a vendors table. I need to track the time the vendors spend on the project. I want to create a dropdown box so the user can select the vendor from the list quickly. Each project will have its own set of vendors, so how do I only show the vendors in the dropdown box for that specific project? I don't want a basic show-all dropdown box as eventually the list will be huge and finding a specific vendor will get cumbersome.

Thanks!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What's your table structure? Specifically what table allocates vendors to projects?

You'd use something like
Code:
SELECT {vendors} FROM {vendor-project table} WHERE {project}='{thisProject}';

Or perhaps
Code:
SELECT DISTINCT {vendors} FROM {sub project table} WHERE {project}='{thisProject}';

Not sure if that helps!

/AJ
 
Upvote 0
I have 3 tables. The tblProjectMain table, then I have the tblProjectSub table. My third table is the tblVendors table. I have a field named lngAutoNumber set as the primary key for each table. In my ProjectSub table I have a field named lngLink that links it to the ProjectMain table. In my Vendors table I have a field named lngLink that I can get to populate with the ProjectSub tables lngAutoNumber, but where I have my issues is sorting the combo box to only show the records that match the currently viewed project.

I am no expert at Access and usually sort out all my problems via these forums and Google, but I can't really find anything related to this. Maybe I am not asking it in the right way.

I will try the suggestions you have posted! Thanks!
 
Upvote 0
You're probably better off having a separate table to allocate Vendors to Projects (or sub projects) as a vendor could do more than one project.
{Table SubProj PK spID} - {Table Proj-Vend spID == vID} - {Table Vendors PK vID}

There're some good relational database resources out there to help understand the structure.

/AJ
 
Upvote 0

Forum statistics

Threads
1,215,632
Messages
6,125,913
Members
449,274
Latest member
mrcsbenson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top