Pass Values from one Subform ontrol to Another Bound Control on the Same Form

tmort

Registered User.
Local time
Today, 07:01
Joined
Oct 11, 2002
Messages
92
I am trying to pass the value for the second column of a combobox in a subform to another control (on the same subform) which has a control source from the underlying query. I have: me!testcontrol = me![subform].Form![control].Column(1) in the afterupdate event of a control. It work as I would expect it to when I open the subform all by itself. The second control gets the value and it is passed to the query. However, when I run the the form/subform I get an error saying that it can't find the subform.
 
If the code is on the same form then all you need is:

Me.testcontrol = Me.ComboName.Column(1)
 
If the code is on the same form then all you need is:

Me.testcontrol = Me.ComboName.Column(1)

I have the same exact issue as tmort. Using Access 2010. When I open the subform by itself, the combo updates the fields correctly. But when I run it as a subform, it doesn't update the fields. There is no error, it just doesn't update.

This is the syntax that works on the form (when not used as a subform):
Me.Recommended = Me.BillingCode.Column(2)
I have tried this variation based on another website:
Me!sfrmAddAccount.Form.Recommended = Me.BillingCode.Column(2)

BillingCode is numeric, however Recommended is currency - not sure if that makes a difference in the coding.

Would really love to get this working in the subform. Looked all afternoon for syntax changes for subforms, but still can't get this working.
 
I finally figured out what was wrong and thought I would post in case this is happening for others. It was the security warning (active content) at the top of the window. I was just ignoring it. Once I clicked on Allow, it worked in the original format - Me.fieldname = Me.fieldtopopulate.Column(2).
 

Users who are viewing this thread

Back
Top Bottom