Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

Passing variables from form to form

$
0
0
I've been searching hours to figure this out.
I need to pass the value of a textbox (FirstNametextbox) to a variable then use this variable in another form.
I used to be able to do a Textbox1.text = form1.textbox.text but that doesn't work. I've tried setting up a public var in Form1: Public Var1 as string = FirstNametextbox.text. then on form2 using it like textbox1 = var1. That didn't work either. Tried a buch of other stuff I found around the net but still no dice so I'm here.

Code:

oDoc.Unprotect()
oDoc.Bookmarks("t1").Range.Text = Projects.FirstNameTextBox.text ''''<-------this is where I need the variable passed to. Projects is the other Form name
oDoc.Protect(Word.WdProtectionType.wdAllowOnlyFormFields)

this is a partial code but I think you can tell where I need to place the variable

Any help PLEASE

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>