Subform Control Value Reference

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Read the past posts - thought I had it; but.....

Have form (frmSwitchboard) with control for field loginName also called
loginName
Have subform on frmSwitchboard as continuous form (frmAccount) with control
for field loginName also called loginName

On frmAccount.loginName GotFocus or OnEnter, if frmAccount.loginName control
is empty, I want to set the value to the parentform control -
frmSwitchboard.loginName.

Keep getting 424 or control not found or form not found. Help me, please?
Thanks,
 
janetb said:
Read the past posts - thought I had it; but.....

Have form (frmSwitchboard) with control for field loginName also called
loginName
Have subform on frmSwitchboard as continuous form (frmAccount) with control
for field loginName also called loginName

On frmAccount.loginName GotFocus or OnEnter, if frmAccount.loginName control
is empty, I want to set the value to the parentform control -
frmSwitchboard.loginName.

Keep getting 424 or control not found or form not found. Help me, please?
Thanks,

Try

Me.Parent!loginName

or

Forms!frmSwitchboard!loginName
 
Brian,
I think it's the opposite problem - can't find the reference for the field
within the subform. (BTW - those didn't work).

Any other ideas?
Janet
 
janetb said:
Brian,
I think it's the opposite problem - can't find the reference for the field
within the subform. (BTW - those didn't work).

Any other ideas?
Janet

I don't understand you. You said that frmSwitchboard is the main form, and
frmAccount is the subform? And, in an event procedure in the subform, you
want to assign the value of a field on the main form to a field on the
subform?

So,

Me!loginName = Me.Parent!loginName

Or, if what you said before is garbage and you want to do it the other way
around i.e. reference the subform from the main form:

Me!loginName = frmAccount.Form!loginName

(assuming that the name of the subform control is the same as the name of
the form i.e. frmAccount)

If it still doesn't work, then something else is wrong and you haven't given
enough information.
 
Back
Top