Subform Control Value Reference

J

janetb

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,
 
B

Brian

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
 
J

janetb

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
 
B

Brian

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top