Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform to Main Form Text Transfer

Status
Not open for further replies.

wayniac42

Technical User
Aug 7, 2007
18
Can someone help me make it so that the subform I am working on transfers the text within the field to a text box on the main form when clicked. Is there a macro available or a line of code that can do this task?
 
In the click event of the subform:
Code:
Forms![yourMasterFormName].txtBoxName = subformTxtBoxName.Value

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Forms![Contacts].NOCtitle1 = NOCtitle.Value

These are the correct names but I still receive an "Expected: End of statement error"?
 
Where have you wrote this line of VBA code ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I wrote this line of code in the subform click event with "Code Builder".
 
Could you please post the whole code (from Sub ... to End Sub) ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Private Sub Form_Click()
Forms![Contacts].NOCtitle1 = NOCtitle.Value
End Sub
 
Ah, bad phrasing on my part. Put the code in the Click event for the control on your subform. e.g. NocTitle or a command button, etc.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I tried using a button inside the subform but I still get that same syntax error :(
 
Perhaps this ?
Forms!Contacts![NOCtitle1].Value = Me![NOCtitle].Value

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
WOW... Thank you soooo much it works perfect now. I really do appreciate all the help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top