Combo Box that fills Text Box in form

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Hi

I am using Windows XP and Access 2000.

I have a combo box (courses) on a form that fills a text box (dates), as
follows:--

Combo box...
Name = course
Control Source = schedule.course
Row source = SELECT schedule.course, schedule.coursedate FROM schedule;
Column Count = 2

Text Box...
Name = maindate
Control Source = =course.Column(1)

This works fine. But there are more than one courses that are the same in
the schedule table. ie the course field in the schedule table hold names of
courses that are the same eg ICS, SWIFT etc The schedule table holds
different dates of courses as well.

So, if I select ICS from the combo box, and there are more than one entries
for ICS with different dates, it will always select the oldest date.

I would obviously like to be able to select any course and have the relevant
date fill the text box.

Thanks in advance.

Richard
 
I've found a solution.

I added the 'id' field to the SELECT row.

SELECT schedule.id, schedule.course, schedule.coursedate FROM schedule;

Changed the Column Count to 3, and changed the Column to 2

Control Source = =course.Column(2)

Richard
 
Assuming you want to have the combo box display the second column, not the
first, change the ColumnWidths property to something like this:

0";1";0"
 
Back
Top