subform field to subform field

B

Beeyen

Good Evening,

For the past week, I have been attempting to get coding to work for having a
field in one subform either link or populate to a field in another subform
field. I have received either no response (as if no one knows) to referrals
about forms and subforms that I don't quite understand or fill this
particular need, which leads me to think others perhaps are not sure of an
answer as well. Does anyone know if this can be done? I am not trying to
affect anyones livelihood, just trying to increase my personal knowledge and
learn to do something new.

Field 1(ProductionCompleted) located in a subform Tab called Production
Field 2(ReceivedfromProduction) located in a subform Tab called
QualityAssurance.


Thanks for your assistance!
 
D

Dirk Goldgar

Beeyen said:
Good Evening,

For the past week, I have been attempting to get coding to work for having
a
field in one subform either link or populate to a field in another subform
field. I have received either no response (as if no one knows) to
referrals
about forms and subforms that I don't quite understand or fill this
particular need, which leads me to think others perhaps are not sure of an
answer as well. Does anyone know if this can be done? I am not trying to
affect anyones livelihood, just trying to increase my personal knowledge
and
learn to do something new.

Field 1(ProductionCompleted) located in a subform Tab called Production
Field 2(ReceivedfromProduction) located in a subform Tab called
QualityAssurance.


There's nothing particularly arcane about referring to controls on one
subform from a different subform on the same parent form -- you just have to
go through the referring subform's Parent property. But I don't understand
from your message what it is that you want to do. You name two fields, but
don't say what you want to do with them.
 
B

Beeyen

Good Evening,

My apologize! On subform tab called Production, I have a radio button next
to Field 1 (ProductionComplete), which when selected enters the current date
and time into the Field 1 (ProductionComplete). I would like to have the
same date and time entered from Field 1 populate in Field 2
(RevievedfromProduction) on subform tab called Quality Assurance.

Thanks for responding!
 
T

tina

i'm not sure about your mention of subform "tabs"; i'm guessing that you
have a mainform, with a tab control on it, and a subform on each of two tab
pages in the tab control. from the standpoint of what you're asking, the
tabpages and the tab control itself are irrelevant, so i won't mention them
again.

to refer to a subform within a mainform, you need to refer to the
"container" control that "holds" the subform. the container control is
called a subform control; it may have the same name as the form object that
it holds, or it may have a different name. to get the correct name, open the
*mainform* in Design view. within the mainform, click once on the subform to
select it - you're actually selecting the subform control. in the Properties
box, click the Other tab and look at the Name property. that's the name of
the subform control, and you must use that name in your reference.

for example, let's say you have a mainform called frmA, and another form
that you're using as a subform, called sfrmB, with a control on the form
called Text1. within frmA, the subform control is called ChildB. to refer to
Text1 from code in the mainform, the reference would be

Me!ChildB.Form!Text1

"Me" refers to the form that's calling the code - in this case, the
mainform. ChildB refers to the subform control. "Form" refers to the form
object that is named in the SourceObject property of subform control ChildB;
that form object is sfrmB. and Text1 is, of course, the control on form
sfrmB.

now let's say you have another subform control within the mainform, called
ChildC. and its' SourceObject is a form called sfrmC. to refer to Text1 from
code in sfrmC, the reference would be

Me.Parent!ChildB.Form!Text1

as before, "Me" refers to the form the code is called from - in this case,
sfrmC. "Parent" refers to the mainform that the subform is "sitting" in; in
this case, frmA. ChildB refers to the subform control, which is also
"sitting" in frmA. "Form" refers to the form object that is named in the
SourceObject property of subform control ChildB; that form object is sfrmB.
and Text1 is, of course, the control on form sfrmB.

hth
 
B

Beeyen

Good Day Ms Tina,

Thank you for responding to my question. I could use some additional
instruction to assist me through, what may seem easy for you but rough for me
on a project. I could use about 20-30 minutes of question and answer and
would like to know the going rate, for that time limit,if at all possible. I
am on CST time.
 
B

Beeyen

Good Day Ms Tina,

Thanks again for responding! So from you explanation, I have

Me!frmQualityAssurance.Form!ReceivedfromProduction=Me.Parent!Production.Form!ProductionComplete

What I was trying to say is: In the mainform, the subform called frmQuality
Assurance, in the field on the subform called RecievedfromProduction will
have the same value or information as the subform called Production, the
field called ProductionComplete.

Would this be correct?
 
T

tina

no, i don't think you quite have it. the expression starts as

Me!frmQualityAssurance.Form!ReceivedfromProduction

remember that the "Me" refers to the form that the code is running from.
this part of the code would be appropriate if the expression were running
from the mainform's VBA module.

the second "half" of the expression is

Me.Parent!Production.Form!ProductionComplete

well, wait a minute here. if the code is running in the mainform, then "Me"
refers to the mainform, as i said above. the mainform has no "Parent". this
part of the code would be appropriate if the expression were running from
the frmQualityAssurance subform's module.

what form module actually holds the expression you posted?

hth
 
T

tina

i don't do phone calls, hon. let's keep it in the newsgroups, where the Q&A
may help somebody else - and where others may jump in to help you, as well.
 

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