PDA

View Full Version : Solved: CurrentRecord Question



JustJerry
09-01-2005, 04:08 PM
Hello Again Everyone,

On one of my subforms, I have a control, I'll call Control A, that I would like to have filled automatically if the user chooses a specific option from another combobox on the same subform. However, I would like Control A's value to equal the record number of the Main form.

So, from the subform, how do I access the Main form's record number to be able to assign it to my Control?

I tried using the
Me.CurrentRecord from the Main form to assign the value, but it would be better if I can perform the operation from the Subform when needed.

Thank you,

Jerry

jadedata
09-02-2005, 04:47 AM
Use the AfterUpdate Event of the combobox to drive the action


Public Sub cboSomethingOrOther_AfterUpdate
if me.cboSomethingOrOther="This" then
me.parent.txtControlA = "Something"
else
me.parent.txtControlA = "Other"
end if


in this phrase "me." is the subform referring to itself
"me.parent." is the subform referring to its daddy (the main form)

There are a few other ways to do this also but this is the most direct

JustJerry
09-02-2005, 08:54 AM
THANK YOU!!! :friends: Gotta Love this place!