473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

update textbox based on combo box selection

14
I have one questions about my database. I have made couple of tables and some forms and a report.

I have a table called CourseNumbers with 2 fields, one is the coursenumber (ex. CI-120) and other is the description of that course (ex. xxxxxx)

Now in my form i have a combo box of coursenumber fields where a person can select which course number they want, then that selection is written in the course information table under coursenumber. what i want is when someone selects this course #, the description field will be filled in automatically, and the info from this txt field will then be written into the course information table under the field name description where all the data will be held.

Im not sure how i can do this and if its going to work.

Or if u can help me lets say, have a combo box with all the Numbers, when that is selected in the text box i want it to display the text description of that coursenumber.?

right now i have it where the combo box is selected and the text box a person has to write info in it and then that info is store in course information table.

thanks in advance
slavisa
Apr 26 '07 #1
6 10517
missinglinq
3,532 Expert 2GB
I'm a little confused as to exactly what it is you're trying to accomplish here, but in order to have a combo box that retrieves the course descriptions:

1) Create a form using the table CourseNumbers as the Record Source.
2) Goto the Field List and drag the CourseDescription field onto the form
3) Place a combo box on the form
4) Select "Find a record on my form based on the value I've selected..."
5) Next
6) Select CourseNumber
7) Next
8) Size the Combo box column
9) Next
10) Name the combo box
11) Finish

Now the user can use the dropdowwn arrow of thecombo box to retrieve the course description or simply start typing the course number in and the combo box will start to autocomplete the entry. When the correct entry is found hit <Enter> and the course description should be retrieved.

Good Luck!



I have a table called CourseNumbers with 2 fields, one is the coursenumber (ex. CI-120) and other is the description of that course (ex. xxxxxx)

Or if u can help me lets say, have a combo box with all the Numbers, when that is selected in the text box i want it to display the text description of that coursenumber.?
May 4 '07 #2
JConsulting
603 Expert 512MB
if your combo box displays both the course and the description, and if your combo box is bound to the course number field, and you want to "auto-populate" the description on the same record,

In the After_Update event of your combo box

me.description = me.mycombo.column(1)

column 0 being the far left column (which I Assume is the Course number) and column 1 being the description.
J
May 6 '07 #3
I wanted to bring this back to the top, as it exactly pertains to what I am needing help on, but it did not help me

I have two records in a form that are from the same source table. I want the second field (genus and species) to populate when I select the first field (which is the species common name).

Neither field,I should add, is the master key for the form. Rather the unique id is the observation number. Can someone help?

I feel like the suggestion from missinglinq is getting me close, but the combo box will not allow me to perform the lookup from the source table, only from the table that is the one I am trying to populate with the form.
Jun 5 '07 #4
vkong85
24
i think i know what you are trying to accomplish because i've done the same. what i did (through some struggle) was figure out how to use a DLookUp. Basically its a command that tells the computer to lookup a certain value from a field given a certain criteria.

So if ure master field has the course number and the description then it will match the description to the course number and all you have to do is tell the computer where to send the course description and in turn it will fill that value with the description.

Be aware that DLookUp can be tricky but it is extremely useful... there are also plenty of posts concerning DLookUp on the forum.
Jun 5 '07 #5
Okay, I have been playing with this DLookup for awhile. It looks like this

=Dlookup("[SpeciesScientificName]","CtblSpecies","[SpeciesCommonName]='" &Forms!EOIDForm!SpeciesCommonName & "'")

I have it located in the after update portion of the SpeciesCommonName Combo box. When I put the form into data entry mode, it lets me select a combo box option, just fine, but then it doesn't do anything. No Error messages or anything?

My question, and it might be a stupid one, is how does this string tell Access to write the lookup value into the Text box on my form for SpeciesScientificName? I feel like there is nothing directing to program to do something with the lookup value once it is obtained? Thanks for any help!

I tried out the various components in the Immediate window, with hard coding, and everything seemed to work fine. So, I think I have the expression and domain correct. However, I worry that the criteria is all messed up.

Wolfe
Jun 6 '07 #6
JConsulting
603 Expert 512MB
Okay, I have been playing with this DLookup for awhile. It looks like this

=Dlookup("[SpeciesScientificName]","CtblSpecies","[SpeciesCommonName]='" &Forms!EOIDForm!SpeciesCommonName & "'")

I have it located in the after update portion of the SpeciesCommonName Combo box. When I put the form into data entry mode, it lets me select a combo box option, just fine, but then it doesn't do anything. No Error messages or anything?

My question, and it might be a stupid one, is how does this string tell Access to write the lookup value into the Text box on my form for SpeciesScientificName? I feel like there is nothing directing to program to do something with the lookup value once it is obtained? Thanks for any help!

I tried out the various components in the Immediate window, with hard coding, and everything seemed to work fine. So, I think I have the expression and domain correct. However, I worry that the criteria is all messed up.

Wolfe

I think you need to open your own question...you've hijacked someone else's thread. You can link to this thread as a reference...but you really need to open your own.
J
Jun 6 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: OhFiddleSticks | last post by:
Does anyone know if there is a way to add a text value to a combo box (the text box part, not the rowsource) in VBA without triggering an update event? I've tried everything I can think of without...
1
by: Maria Joao | last post by:
I have two synchronized combo boxes and after the selection of the desired record, I need the user to open the related report, by pressing a button. My problem is that a combo box doesn't update...
3
by: lee.croucher | last post by:
I'm trying to update my units in stock within a table. This needs to be updated whenever a product is sold. The products which are sold are selected through a combo box on my transaction form. ...
2
by: Manish | last post by:
Hey folks I am having a weird problem in ASP .Net. My page is in C#. I have a datagrid, which populates based on selection in drop down box on ASP page. This datagrid has template textbox colum in...
6
by: eclypz | last post by:
Whe i use a combobox, and i want it to update it's value i use the code ME.cbxname.Requery How can i do that to update the value of a textbox? i have already try to use the same expression,...
5
by: njb35 | last post by:
Hi all I'm beginning my foray from VBA into VB 2005 Express, and enjoying some of the efficiencies it provides! I'm stuck with some dataset handling however that I _think_ can be automated but...
4
by: whamo | last post by:
I have the need to populate a field based on the selection in a combo box. Starting out simple. (2) tables tbl_OSE_Info and tbl_Input; tbl_OSE_Info has three fields: Key, OSE_Name and OSE_Wt...
1
by: martin DH | last post by:
Hello, I have a unique situation, I believe. I have a form with unbound textboxes (frmEditReport) - most populate from a search query but one unbound textbox, txt_ReturnInfo, populates based on a...
9
by: Patrick A | last post by:
All, I've got a continuous form with one field on it, with a comob
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.