combobox and text box

  • Thread starter Thread starter viba via AccessMonster.com
  • Start date Start date
V

viba via AccessMonster.com

Hello everybody

I 'am a beginner in programming. I have create a form in M Access .and inside
i have a combobox with record in one column. Nearby, i add a textbox. my need
is to feel the textbox with the records in one is selected in the combobox.

Can anyone help me please?
 
Assuming your combo is called cmbcombo.
Assuming your text field is called txtfield
The code really depends on the number of columns you have, (i.e. if
your first column's width is 0 then you will need to use different
code)

On the after Udpate event of the combobox... write the following.

(assuming there is only one column)
Me.txtfield = me.cmbcombo.value

Assuming there are more then one.

Me.txtfield = Me.cmbcombo.column(1)

Where 1 is the second column (column starts from zero)

Hope that help,

Regards
Anthony Moore
 
RE,

the code works very good. But the probelm is the textbox isn't filling when
i check other record. it just change the record but not add a new record from
my combobox.
I'am sorry my english is very bad, french is my mother tong.
 
The only time the Text box / Drop Down list will refresh when you
change record, is if a) it is bound to a control or b) you have On
Current code that run, and re-evaluates what the value should be.

Let me know if this hasn't helped, and I will do what I can to further
assist you.

Regards
Anthony Moore
 
Back
Top