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

Passing Strings Between Forms

Status
Not open for further replies.

Brenton

Technical User
Jul 29, 2002
43
US
my problem is probably a simple fix

I have 2 forms inside of FrmMain(MDI Form)
Form1 & Form2
I have a RichTextBox in each Form
I am trying to get the selected text from form1.richtextbox to form2.richtextbox

my current code is very simple

Sub form2_Initialize
richtextbox.text = frmmain.activeform.richtext.seltext
End Sub

This works fine, but If I close out form2 and highlight different text in form1.richtextbox
and open form2 again nothing appears in form2.richtextbox.

Can Anyone help me?
 
Why don't you put the rtf text into a module level variable, that way you can check it on form load, or whatever event you need.
 
Brenton - there is a FAQ on this subject.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top