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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating Subforms 1

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
AU
Hi,
Is it possible to update a text box on a subform from the mainform. If it is possible how would it be done.

many thanks
 
Hi PHV
Many thanks for your reply.
I did read the link, and tried the code, However I could not get it to work.

This is what i did. I placed the subform on the mainform. I placed a text box on the mainform and used the following;
Using the link:
Forms![main form name]![subform control name].Form![control name]
I then inserted the mainform name, subform control name, the control name of the field on the mainform.
Yet this only came up with #name#. So there must be a problem with the syntax I have used. I tried that which you gave but was not sure of the "some value"
I just dont' know where to go from here. I have no problems on doing it the reverse, ie: getting data from the subform to the main form. Its doing it the other way round..!

Many thanks


 
I placed a text box on the mainform and used the following
used WHERE ?
 
BTW, if it's the ControlSource you may simply use the expression builder (loaded forms).

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya techkenny1 . . .
techkenny1 said:
[blue]Is it possible to update a text box on a subform from the mainform. [purple]If it is possible how would it be done.[/purple][/blue]
[blue]It all depends on how you intend to update the textbox! [/blue][surprise] So how do you intend?

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hi guys,
thanks for your reply. I guess the common practice for getting data from a subform to the mainform would be as follows;
=[subform name].[Form]![textbox]
I wondered if it was possible to use the same method for getting the data from the mainform to the subform.
So that on a command button (update),I could use this:
[subform name] = [mainform name]

Does this make sense?

Many thanks
 
If ControlSource:
=[Forms]![mainform name]![textbox name]

If by VBA
Me![subform's textbox] = Me.Parent.Form![mainform's textbox]

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top