Link to home
Start Free TrialLog in
Avatar of daintysally
daintysallyFlag for United States of America

asked on

How to update text field on access 2007 form based off of value chosen in combo box on the same form

Hi Experts,

I have been unsuccessful in trying to follow the code in the related thread to update the value in my form's textbox field based off of the selected value in the form's combo box field.  When I implemented the code from this thread, it compiles fine, however all it does is places the select statement in the textbox field on the form when I run it.  Any help is greatly appreciated...please tell me what I need to do differently?

Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

if you want to get the value from the second column of the combo box, use the afterupdate event of the combo box

private sub combo0_afterupdate()

me.textbox1=me.combo0.column(1)

end sub

you also need to set the column count of the combo box to at least 2, assuming the rowsource of the combo have two columns


post the rowsource of the combo box if you need more help



ASKER CERTIFIED SOLUTION
Avatar of Nick67
Nick67
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of daintysally

ASKER

Thanks a lot Nick67!!!  This was very easy to follow...you hit the nail on the head!!!
Glad you got it cased :)