Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

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?

  • 2
1 Solution
Rey Obrero (Capricorn1)Commented:
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()


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

The related solution is messing with the row sources of the comboboxes (what values appear in the dropdown) and not their values.
That doesn't appear to be what you want to do.

Here's a small sample that demo's combobox updates.
Open the form, and change the comboboxes values.
Look at the two textboxes, and then look at the underlying code.

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now