Combo Box that fills Text Box in form


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
 
Ad

Advertisements

R

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
 
R

Richard

Sorry, forget that. It doesn't work.

The combo box gets filled with the id.

Richard
 
K

Ken Snell

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"
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top