select from combo box and display a value in text box

J

Jason Lim

Dear all,

I am at my wits' end trying to figure out this. Please help.

Let's say I have a table, named tblSpecimen. In the table, the fields
are ID, Name, Length1, Length2, and LengthAVG.

And, I have a form with a combo box and a text box.

So, in my combo box, I typed out the list - Length1, Length2,
LengthAVG

If I select Length1 from the combo box, its value should be displayed
in the text box. I should be able to change the value if I want.
Simarly, if Length2 is selected, its value should be displayed in the
text box.

How do I actually go from here? I am totally confused. Please help..

n btw, as for the combo box, I cant use *select from row source
right.. since that would only give me the values in a field, not the
field name itself....

thanks in advance...

=)
 
J

Jeanette Cunningham

Hi Jason Lim,
you would usually use the combo to search for a record or use it to enter a
value for a field in a record.
What you described is different again, and not what a combo is designed to.

Are you trying to find a particular record on your form? or
are you trying to enter data?

If you are trying to make a search form, have a look at this sample on
http://allenbrowne.com/ser-62.html



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
T

Tom van Stiphout

On Wed, 3 Sep 2008 21:06:31 -0700 (PDT), Jason Lim

If I understand you correctly you want to bind a given field in the
underlying recordsource to your textbox. Try this:
In the combobox.AfterUpdate event:
Me.MyTextBox.ControlSource = Me.MyCombobox
(of course you need to substitute the control names for your control
names)

-Tom.
Microsoft Access MVP
 
J

Jason Lim

Dear Tom van Stiphout,

Thanks a lot. My problem is now solved. =)))

and, btw, just out of curiosity, can Access automatically calculate
the average value (LengthAVG), and store it?

Thanks again...

=)
 

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