combobox and text box

  • Thread starter viba via AccessMonster.com
  • 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?
 
A

Anthos

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
 
V

viba via AccessMonster.com

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

Anthos

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
 

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