A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo Box that fills Text Box in form



 
 
Thread Tools Display Modes
  #1  
Old April 4th, 2010, 01:05 PM posted to microsoft.public.access.forms
Richard
external usenet poster
 
Posts: 1,419
Default Combo Box that fills Text Box in form

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
  #2  
Old April 4th, 2010, 01:31 PM posted to microsoft.public.access.forms
Richard
external usenet poster
 
Posts: 1,419
Default Combo Box that fills Text Box in form

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

"Richard" wrote:

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

  #3  
Old April 4th, 2010, 01:47 PM posted to microsoft.public.access.forms
Richard
external usenet poster
 
Posts: 1,419
Default Combo Box that fills Text Box in form

Sorry, forget that. It doesn't work.

The combo box gets filled with the id.

Richard

"Richard" wrote:

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

"Richard" wrote:

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

  #4  
Old April 4th, 2010, 01:58 PM posted to microsoft.public.access.forms
Ken Snell
external usenet poster
 
Posts: 177
Default Combo Box that fills Text Box in form

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"


--

Ken Snell
http://www.accessmvp.com/KDSnell/


"Richard" wrote in message
...
Sorry, forget that. It doesn't work.

The combo box gets filled with the id.

Richard

"Richard" wrote:

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

"Richard" wrote:

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



  #5  
Old April 4th, 2010, 02:53 PM posted to microsoft.public.access.forms
Richard
external usenet poster
 
Posts: 1,419
Default Combo Box that fills Text Box in form

Thanks Ken

That worked a treat.

Richard

"Ken Snell" wrote:

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"


--

Ken Snell
http://www.accessmvp.com/KDSnell/


"Richard" wrote in message
...
Sorry, forget that. It doesn't work.

The combo box gets filled with the id.

Richard

"Richard" wrote:

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

"Richard" wrote:

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



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:50 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.