Textbox Automatically Fill in with A value

Textbox Automatically Fill in with A value

Post by ZmVs » Fri, 09 Mar 2007 12:19:26


I used an unbound textbox which automatically fill in with a value after I
select an item from a combo box on a form (e.g., select a Product ID in a
combo box, and have the Product Name automatically display in a textbox)? "

I had came across this in The Access Web. It does answer part of my
question. However in the form, there are more than 1 record. Once I go to the
2nd row and I select another Product ID int eh Combo Box, the 1st record
automatically was updated.

How should I go about doing this?
 
 
 

Textbox Automatically Fill in with A value

Post by Rick Brand » Fri, 09 Mar 2007 12:28:58


You cannot make an unbound textbox have a different value per-record in a
continuous form.

If instead of using code to "push" the value from the ComboBox into the unbound
TextBox (which I assume comes from a column in the ComboBox other than the one
displayed after making an entry) you just used a ControlSource expression of...

=ComboBoxName.Column(n)

...where 'n' is the zero-based column position that you want displayed then that
would allow a different value to be displayed per row.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com

 
 
 

Textbox Automatically Fill in with A value

Post by ZmVs » Fri, 09 Mar 2007 13:50:02

Hi Rick, thanks for your reply. Am I to understand that I should put a 'n'
after the Column? Mine is [cboProductName].[Column](1).

Please explain more in details.
 
 
 

Textbox Automatically Fill in with A value

Post by Rick Brand » Fri, 09 Mar 2007 21:24:39


No. I meant replace n in my example with the appropriate column position you
want to see.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com