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

subform data 2

Status
Not open for further replies.

kpryan

Technical User
Aug 24, 2005
282
US
Hi all,
How can I update data from a mainform to a subform?
I could use link child/master but I don't want to go this way.
Any help greatly appreciated.

Ken
 
What do you mean by update. Is there data on the main form you want to copy into the subform? or do you wish to move to another record on the main form and need the subform to requery in simpathy with it?


Ian Mayor (UK)
Program Error
Always make your words short and sweet. Because you never know when you may have to eat them.
 
Hi kpryan,
Could you explain a little more what you try to achieve. Normally you would't put data from the mainform on to the subform (except for the FK-field).

Pampers [afro]
Keeping it simple can be complicated
 
Hi guys,
thanks for getting back to me.
Yes, I have data on the mainform that I want on the subform. I know that I can use the link child/master, but don't want to go this way. I have some currency field data on the mainform to be on the subform.

Many thanks,

Ken
 
How are ya kpryan . . .
I totally agree with [blue]Pampers![/blue] . . . but if you must, here's a starting point (considering you've yet to explain the almighty [blue]Update![/blue]):
Code:
[blue]   Dim frm As Form, sfrm As Form
   
   Set frm = Forms![MainFormName]
   Set sfrm = frm![subFormName].Form
   
   [purple][b]sfrm[/b][/purple]!TextboxName = [purple][b]frm[/b][/purple]!TextboxName
   
   Set sfrm = Nothing
   Set frm = Nothing[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Sorry that it took a while to get back,

If you really want to do this, you could reference the value from the mainform onto the subform...

Go to the control (textbox) on the subform, go the record source property, click on the ... and choose for the Expression Builder and build the reference string. You get something Like: Forms![Form4]![Text2] - where Text2 is the textfield on the mainform.



Pampers [afro]
Keeping it simple can be complicated
 
Hi TheAceMan1,

Thanks for your thoughts. Perhaps I did not mean to say update!... All I wanted to do was to get that info from the mainform to the subform.
Thats the trouble with us novices we know what we want to do but not sure how to word it!

many thanks


Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top