Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send value in Subform combo column to field in Parent form?

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
US
I have a form/subform relationship. The parent form has a blank text box linked to a blank field in a table (among 20 other fields).

My subform consists of 1 combo box that lists values in a table. Column 1 is the Key Field (autonumber) while Column 2 is the name.

What I want to do is in the afterupdate() for the combo box, I want it to send the value of the first column to the blank field in the parent form.

This is the code I'm trying to use - but it gives me an error message..."object not found"

Private Sub poc_ven_box_afterupdate()

Me!POC_Ven_Box.Column(0).Value = [forms]![applications]![LINK_POC_VEN]Value

End Sub

Anyone have any ideas why I can't send the value of the first column over to the other field after an update?

Thanks!
 
Hi!

Try it like this:

Private Sub poc_ven_box_afterupdate()

[forms]![applications]![LINK_POC_VEN].Value = Me!POC_Ven_Box.Column(0).Value

End Sub

hth
Jeff Bridgham
bridgham@purdue.edu
 
Hey - That didn't give me any error messages, but it also didn't add it to the field on the parent form. It's still blank :-(
 
i just realized i can potentially simplify it.

Here's the new scenario:

I have 1 form. This form has a combo box with 2 columns (the first column is invisible). This combo box references a table, and the user selects a value from that table.

I then want the value of the invisible first column to get shot into another field.

So basically -


Private Sub poc_ven_box_afterupdate()

me!POC_VEN_BOX.Column(0).value = link_poc_vend.value

End Sub

But this doesn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top