Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Access

select from combo box and display a value in text box

 
Jump to:  
 
Jason Lim
PostPosted: Thu Sep 04, 2008 4:06 am    Post subject: select from combo box and display a value in text box
       
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...

=)
 

 
Jeanette Cunningham
PostPosted: Thu Sep 04, 2008 4:06 am    Post subject: Re: select from combo box and display a value in text box
       
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
LINK



Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


"Jason Lim" <kucinghutan@gmail.com> wrote in message
news:a847008c-146e-45cf-a610-f4d209fd32a9@k36g2000pri.googlegroups.com...
Quote:
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...

=)
 

 
Tom van Stiphout
PostPosted: Thu Sep 04, 2008 4:06 am    Post subject: Re: select from combo box and display a value in text box
       
On Wed, 3 Sep 2008 21:06:31 -0700 (PDT), Jason Lim
<kucinghutan@gmail.com> wrote:

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




Quote:
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...

=)
 

 
Jason Lim
PostPosted: Thu Sep 04, 2008 5:52 am    Post subject: Re: select from combo box and display a value in text box
       
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...

=)

On Sep 4, 1:06 pm, Tom van Stiphout <no.spam.tom7...@cox.net> wrote:
Quote:
On Wed, 3 Sep 2008 21:06:31 -0700 (PDT), Jason Lim

kucinghu...@gmail.com> wrote:

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



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...

=)- Hide quoted text -

- Show quoted text -
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

sypialnie metalowe fronty meblowe darmowe smsy Powermed opony