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

Passing value from one form to another

Status
Not open for further replies.

load3d

Programmer
Feb 27, 2008
117
US
I want to pass a value from one subform to another I've been able to successfully do this in this past using the stlinkcriteria function. However, this has proven to be ineffective at times. Does anyone know of a different way to do this?

 
How are ya load3d . . .

Assuming both subforms are on the same mainform, it all depends on where the code is running (effects subform referencing).

The following example assumes you'll double-click a textbox on subform1 and transfer (copy) the data to a predefined textbox on subform2 (note SF stands for subform):
Code:
[blue]   Me.parent![SF2].Form![SF2TextboxName] = Me![SF1TextboxName][/blue]

[blue]Your thoughts? . . .[/blue]

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

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Okay, that's a good start. Thanks. What if subform2 isn't open at the same time as subform1?
 
load3d said:
[blue]What if subform2 isn't open at the same time as subform1?[/blue]
For a mainform with subforms this is not a problem. All subforms open wether the recordsource returns records or not.

Your question relates more to [blue]two independent mainforms[/blue], each with subform. In this case ... [blue]Yes![/blue] ... both mainforms have to be open.

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

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

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top