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
0
Utf
4/4/2010 12:05:01 PM
access.forms 6864 articles. 2 followers. Follow

4 Replies
749 Views

Similar Articles

[PageSpeed] 26

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
0
Utf
4/4/2010 12:31:01 PM
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
0
Utf
4/4/2010 12:47:01 PM
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" <Richard@discussions.microsoft.com> wrote in message 
news:E6029DA1-2671-44E6-B0D1-32374F8A78B6@microsoft.com...
> 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 


0
Ken
4/4/2010 12:58:26 PM
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" <Richard@discussions.microsoft.com> wrote in message 
> news:E6029DA1-2671-44E6-B0D1-32374F8A78B6@microsoft.com...
> > 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 
> 
> 
> .
> 
0
Utf
4/4/2010 1:53:01 PM
Reply:

Similar Artilces:

Y axis box size incorrect in Excel 2003
I am having a problem; the y-axis box size does not display the entire text. I cannot change the size of this box. This only happens for the y-axis, not for other axis labels or the chart title. I have tried adding spaces followed by a period to fool the box and this works in Excel, but when I copy the chart to a Word document, the full text, including the final period appears. Hi, Details and suggestions can be found on Jon's page. http://peltiertech.com/Excel/ChartsHowTo/AxisLabelCutOff.html Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "lcare...

Viewing fill colors
I have a lot of fill colors and font colord in my spreadsheets. They show up in print preview but not in normal view. How can I change settings so that these colors show up in normal view? Probably due to Colors are only missing on monitor, due to High Contrast Accessibility option. http://support.microsoft.com/?id=320531 Not your problem below, but might help someone else: Some other options with different color results in Colors as seen in Preview and Print http://www.mvps.org/dmcritchie/excel/colors_print.htm --- HTH, David McRitchie, Microsoft MVP - Excel [site c...

Automatically finishes entering email into TO box
How do I tell MS Outlook to automatically finish entering into the TO box (sending email)when I begin typing the person to whom I am sending mail? thanks! What version of Outlook? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the SWEN virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Gem asked: | How do I tell MS Outlook to automatically finish entering | into the TO box (sending email)when I begin typing the | person to whom I am sending mail? | t...

Run a query based on user input to a text box
I am creating a database to manage Auction Bids for a live radio station phone auction weekend. I have a form where the user is entering names as the bidders call in. I want to be able to have entry into a text box cause a query to run and populate a list box so that if a caller has been entered before, the user can click on an existing name. So for example, if the first keystroke is A , then the list box will be populated with all names beginning with A. If the next keystroke is l to give Al then the list box will be repopulated with only names beginning with Al (e.g. Alice, Aliso...

Two message boxes
I have two message boxes that fire off when I am going to print a report to determine what will show up on the report as far as fields. The first message box is to hide the customer price on a quote, if you answer yes it sets a checkbox on the initial form to true. The next message box is to show or hide the changes made to the quote on the report. If I say vbyes to both of the message boxes the customer pricing will not be hidden as the checkbox is getting set back to false. I am not sure why it is toggling, but it works if I answer yes to the first and no to hte second. It may ...

Automatically fill down formulas when adding a record
I have a data entry sheet which receives one record per row. Some of th columns contain calculated fields and will be hidden. Is there a way t have the formulas automatically fill down when new records are added Thank you -- Message posted from http://www.ExcelForum.com One way is to use Excels built-in dataform. data>form -- John johnf 202 at hotmail dot com "steveski >" <<steveski.11dx8c@excelforum-nospam.com> wrote in message news:steveski.11dx8c@excelforum-nospam.com... | I have a data entry sheet which receives one record per row. Some of the | columns con...

Form
Hi, I am in the process of building an image database. I am almost done with my database. I included a field in a form which is not in my parent table. Now I need to include it in the table. Can somebody explain me how to do it? Thank you verymuch! I assume that the form is bounded aleady to the main table. 1. Open the table in design view and add the field you want 2. Open the form in design view 3. Open the form properties, by clicking on the top left corner of the form 4. Put the cursor in the RecordSource property of the form, on the right you'll see a button with three dots, cli...

Filtered Form Query
I have a form that is filtered using Allen Browne's ajbFindAsUType module (http://allenbrowne.com/AppFindAsUType.html). I want to now create a query that utilizes only the filtered records as its source in order to perform a computation. Is there a way to pass the filtered Recordset into a query via a command button? You can use the RecordsetClone of the form to step through the records. You may be able to pass the Filter from the form on to whatever other operation you need to perform. For example, you could create a report that summarizes the data, and open it like ...

intermittent form's bar
Does everyone to now if there is a way to make intermittent the form's bar? Many thanks for any help! Bye, Stefano. ...

Having 3 .set files with different ISV's and custom form modifications
Currently we have 2 seperate SQL instances for 2 different environments. We want to be able to create one environment that has 3 companies, with one .set file with customizations, and alot of ISV's; one company with customizations and 2 ISV's; and create one new company with a plain vanilla GP only 2 ISV's no customizations; We currently have the 2 instances with the first 2 set up that way and now looking to consolidate into one environment with the company dropdowns together. Will this be a pain to manage or is it even possible?? ...

Text is added as attachment after copy and paste
Hi I am using outlook 2000 and every time I want to copy and paste text from somewhere else (e.g. browser), it adds the content as an html-page-attachment to my new mail. I just want to have it added as simple text in the mail-body regards R. Save the text in notepad or something and then Insert the file - but check the button so it inserts it as text, not just as an attachment ;-) r@gnar.de wrote: > Hi > > I am using outlook 2000 and every time I want to copy and paste text > from somewhere else (e.g. browser), it adds the content as an > html-page-attachment to my new ...

populating an Access table from a text file
A text file has data in a format like the below: Title1 Cell 1 data Title 2 Cell 2 data Title 3 Cell 3 data .. .. .. Title 10 Cell 10 data Title 11 Cell 11 data .. .. .. Title 15 Cell 15 data .. .. .. Title N Cell N data I guess I can read this using some VBA code posted at http://www.mvps.org/access/modules/mdl0057.htm and http://www.granite.ab.ca/access/readtextfile.htm, add an Instr function to it so that when I read the text file, I know when to insert the data properly in the table. 1. Is there another way I can directly import the data into an Access 2...

Name Drop-Down Box
I've got a 50 sheet excel document and i want to create names to get m to A1 on every page, so I don't have to scroll left and right all th time. So, here's my problem. I would like to increase the number of names shown when i click th drop down box. Right now it shows 7, in Office 2003. I would love t increase that to show 50, or else I�m not really getting th functionality I�m looking for. I think this will take some kind of registry tweak. Does anyone know how/where I can? Thanks in advance, Chri -- cbh3571 ----------------------------------------------------------------...

Display Query Results on top of a Form
I have a query which runs from a control button on a form. When the query runs, the results are displayed behind the form. The user then has to minimize the form in order to see the query results. How do you set the query results to display on top of the form? You could put the following line in the code for the On Click event of the button being pushed: DoCmd.Minimize That will minimize the form and the query should be on top. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Kristin M" wrote: &...

Loading subform with data from main form
I thought this would do it: I put this in the before insert of the subform: Me!txtJobID = [Forms]![frmInvoice]![txtJobID] frmInvoice is the main form. What can I do differently to make this work? Thanks. SAC wrote: >I thought this would do it: > >I put this in the before insert of the subform: > >Me!txtJobID = [Forms]![frmInvoice]![txtJobID] > >frmInvoice is the main form. > >What can I do differently to make this work? You could use that code in the BeforeUpdate event, but this whole exercise would be automatic if you set the subform control's Link M...

displaying a table on a form so that we can insert a new record at any place rather that at the end
how can i display the table on a form so that the user is able to insert a new record not only in the last, but also in any place of his desire. he must be able to insert a new record even before the first record. how can i accomplish this? can any body help me out please........ hi Ravindar, ravindar thati wrote: > how can i display the table on a form so that the user is able to > insert a new record not only in the last, but also in any place of his > desire. he must be able to insert a new record even before the first > record. Tables in Access (in a database) are a differen...

help on combo box...
i have a combo box cbPayee... on top of the list is "add new payee..." below which are the other names ...how can i enable it that when the 1st row is selected, a pop-up form wud appear for data entry... thanks... -- ai® Message posted via http://www.accessmonster.com Use the After Update event of the combo. If Me.cbPayee = "add new payee..." Then 'Do it here Else However, a more common technique is to use the combo's NotInList event for this purpose. Set the combo's Limit To List property to Yes. Delete the "add new payee...&q...

Resizing "comments" boxes in a workbook all at once
I do not know how I did it but all my comments (about 200 of them) defaulted to a size that makes them almost invisible with only the tails showing. The only way I can resize them is by going into each one and change the shape. I gave up after about 50 and I am now desperate for the information contained in all comments boxes. Is there a way of making all the boxes the same size in one go? How did I manage to screw up and how do I avoid doing it again. Thanks Rita You could resize them programmatically. There's sample code here: http://www.contextures.com/xlcomments03.html#Re...

Suggest Names/Auto Fill
This is driving me crazy. Outlook has picked up on an email address i incorrectly typed in Now anytime i try to type the correct address it suggest/auto fills the wrong name until i finish typing the right address. Is there any way to get outlook to stop doing this? Can we clear the bad name out?? Please advise Any names it should be trying to Autofill should be coming straight from your address book. So if you go into your address book and find the offending address, simply delete it and type in the correct one. Or, if you want, you can completely disable Autofill by going t...

= Text formula problem
Hi Everyone, I am using an excel spreadsheet as a linked table in an access database for an update query. I had it working very nicely for a period of time. I am not sure if some Microsoft update caused a problem or what. The field I use t o update my database didn't work until I used this formula to make a new row. I have a column of numbers which was retrieved from a data miner program it's called Acct. For some reason Access doesn't like the formatting so I insert a blank column to the right and call that PtNum. In the first cell of this column which is C2, I type ...

Writing rules: Looking for text string in HTML Body
I am trying to fight SPAM by deleting messages that contain certain text strings in the body. It seems certain SPAM messages run in streaks and I can get hundreds of the same message but I am unable to block them with my SPAM software so I want to write a rule to delete them. Writing a "normal" rule and selecting: "with '<TARGET TEXT>' in the body" may not work on an HTML message if the sender has disguised that text as follows: Displayed text: a new home purchase HTML Code for same: a n<AJZDE>ew home purcha</LAHIOJ>se How can I fil...

How do I save Visio help text boxes as html
I have a Visio process flow containing help text boxes (mouse overs) and hyperlinks that I want to save as a web document (html). When saved, the help text boxes are no longer available. How do I save as html so that they are available? ...

Comment box defaults
Can I change the comment box default font and stop it inserting my name in each box? Peter delete user name from the tools > options > general > delete user name from the tools > options > general and replace with a space To change the default font size (Note: this will change the settings for tooltips in Excel and other programs) -- Right-click on the desktop, and choose Properties On the Appearance tab, click Advanced. From the Item dropdown, choose Tooltip Choose a font Size, click OK, click OK (Note: selecting a font type he...

Changing field sze of labels and text boxes independently
I am using Access 2007. I created a report with the wizard. Now I can't change the size of labels or text boxes without all the fields/labels changing in concert. What do I do to permit changing these things individually? Must be simple, but the help function in Acess 2007 I find not very helpful. On the arrange tab, look for the button for Remove. Highlight the controls and click remove. This will ungroup the controls. Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia "gg" <gg@discussions.microsoft.com> wrote in message news:92DDB6...

how do i show text in the data field of a pivot table?
If you put a text field into the data area of a pivot table, it will summarize the field to show a count, instead of showing the text. You can place the text fields in the Row, Column or Page areas, where their text will show. pum75 wrote: -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html ...