Nope....there was no code used to do this...
I built the table and enetered some sample data. SImlpe enough. Then I created the form. I began with the combo box. I used the combo box wizard, selected the department as the field and finished the wizard. I then went into the record source for the combo box by clicking the ellipse (3 dots) at the end of that property line. In the first BLANK field, I right clicked and select properties. I made sure the Unique Value property was set to yes. I now will only see one of each department. Next, I built the list box. Used the same procedure as the combo box mostly, selecting the department and date in the wizard. After the wizard was done, I set the department field width to 0, and in the row source for the list box, I set the department equal to the combo box value and the date to anything greater than or equal to today.
The last part, the text box was tricky. I at first tried a few recordset combinations, but I couldn't get it to work. Then I remebered a litle used feature of the query. I built the query, made the departemnt equal to the combo box, and the date anything greater than or equal to today. I then right clicked in the first BLANK field and selected properties. There is a property called TopValues. Noramlly this is set to all, so Access displays all records that meet the criteria. You can set this to a percentage or an exact number. I made sure the dates were in ascending order, and set the TopValue to 1....making Access only give me the first record it found.
To tie it all together, I used the combo box AfterUpdate property to requery everything every time it was changed.
Hope this makes it clearer for you....if not, please let me know. Also, if you need an SQL statement or something for this, I can get it for you from the database. Just let me know. Programming isn't a profession of choice.
It's a profession of calling...
"Hey Programmer, your application broke again!"
Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com