If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Selection from combo box doesn't fill text box
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? |
#2
|
|||
|
|||
Selection from combo box doesn't fill text box
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)? -- _________ Sean Bailey "So Call Me Crazy" wrote: 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? |
#3
|
|||
|
|||
Selection from combo box doesn't fill text box
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! "Beetle" wrote: 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)? -- _________ Sean Bailey "So Call Me Crazy" wrote: 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? |
Thread Tools | |
Display Modes | |
|
|