Daniel made a slight typo.
The basic syntax is actually
Forms![NameOfParentForm]![NameOfSubformControl].Form![NameOfControlOnSubform]
Based on the information you've provided, it probably should be
Forms![Request Entry]![RecordDetails].Form![PartNumber]
although depending on how you added RecordDetails as a subform, it's
possible that the name of the subform control on the Request Entry form may
be something different than RecordDetails.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
PD said:
Daniel,
I tried "Me.PartNumber1 = Forms![RecordDetails].Form.[PartNumber]" and it
would not work. The error message indicates it can not find the form
"RecordDetails". I tried numerous variations with out any luck.
My parent form is "Request Entry", the two subforms are "Part_Lookup"
(contains "PartNumber1") and "RecordDetails" (contains "PartNumber").
"Part_Lookup" subform is a datasheet view sourced from a query, this
contains the part number I want to double-click. "RecordDetails" is a
form
view subform sourced from a table, the destination field is a combo box
"PartNumber.
Thanks again!
--
PRD
:
Then you have to explicit select them, the 'me.' will not work
The basic synthax form is
Forms![subform]![subform].Form.[ControlName]
You'd have to try something like
Forms![subformName].Form.[txt2] = Me.txt1
OR
Forms![subformName].Form.[txt2] = Forms![subformName].Form.[txt2] &
Me.txt1
--
Hope this helps,
Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.
:
Daniel,
Having trouble with this, I provided incorrect information. The two
text
boxes are located on two different subforms. I imagine this changes
things?
--
PRD
:
This isn't hard to do, but I'd be asking why? You shouldn't be
looking to
duplicate data...
That said, the answer to your question is:
Assuming 2 textboxes called txt1 and txt2 and when I double-click on
txt1 I
would like its value copied to txt2, the code for the double-click
would be
Me.txt2 = Me.txt1
it could also be
Me.txt2 = Me.txt2 & Me.txt1
if you wish to keep whatever was already in the textbox and add the
info to
the end of it.
--
Hope this helps,
Daniel Pineault
If this post was helpful, please rate it by using the vote buttons.
:
I would like to double-click a text box to select the text and have
it
automatically pasted to another text box on the same form.
Any ideas?
Thanks,