Selection from combo box doesn't fill text box

S

So Call Me Crazy

I have a combo box with 2 columns. Combo's bound column is 1 -- that part is
working great. I want the combo's 2nd column to fill a text box. The caviat
to this is that the text box is bound to a field in the table. I want the
user to be able to change the value stored in that bound text box if they
change the value via the combo box.

What is happening, however, is that the text box ends up being cleared out.

The code I have is extremely simple. In the AfterUpdate event of the combo
box, I assign the text box the contents of the second column from the combo
box:

me.textboxname = me.comboboxname.column(2)

So, what am I missing?
 
B

Beetle

The column property is a zero based numbering system, so the first column
is Column(0), second is Column(1), etc. You said your combo box has two
columns, so Column(2) would refer to the third column, which doesn't
exist.

Having said that, what are you trying to do? Are you redundantly storing the
same data in two different tables (which is usually not necessary to do)?
 
S

So Call Me Crazy

Oh brother! I knew it was something really silly! That was exactly my
problem.

I forgot that, programmatically, it was zero based. But that within Access'
form builder, it isn't!

Thanks so much!
 

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