Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update combo box as result of another combo box

Status
Not open for further replies.

MaggieLeatherman

Programmer
May 9, 2004
59
0
0
US
Project #’s consist of “yr-proj#”
For example: 07-690 or 06-700

There could be 40 or more projects to pick from so I’d like to first narrow down the list by ProjYr. Depending on the year chosen from the cboProjYr combo, this will only show the projects from that year only.

I have 2 combo boxes, cboProjYr and cboProjNum
I've been setting the cboProjNum.recordsource in the cboProjYr.afterupdate method but when I click on the cboProjNum box a window "Enter Parameter Value" pops up.

Any Idea how to implement this code? Thanks, Maggie
 
Hey Maggie,

In the RowSource of cboProjYr put only the two digit years of your projects "07", "06", etc.

In the RowSource of cboProjNum put the following (I'm guessing at your field names and structure here):

Code:
SELECT Left([YourProjectNumberFieldName],2) AS ProjYear
FROM tblYourProjectTable
WHERE (((Left([YourProjectNumberFieldName],2))=[Forms]![YourFormName]![cboProjYear]));

When the user picks a year the next combo box will only show projects for that year.

Let me know if you need any more clarification.

Monkey

Give a man a fish, and you feed him for a day.
Teach a man to fish, and you feed
him for life.
Send a man to Tek-Tips and the poor sap can find out how to fish on his own, and learn more by doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top