A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Selection from combo box doesn't fill text box



 
 
Thread Tools Display Modes
  #1  
Old May 14th, 2008, 09:31 PM posted to microsoft.public.access.forms
So Call Me Crazy
external usenet poster
 
Posts: 40
Default 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  
Old May 14th, 2008, 11:16 PM posted to microsoft.public.access.forms
Beetle
external usenet poster
 
Posts: 1,254
Default 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  
Old May 15th, 2008, 02:35 PM posted to microsoft.public.access.forms
So Call Me Crazy
external usenet poster
 
Posts: 40
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:46 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.