MagicCity33
Member
I'm trying my hardest to get adjusted to writing code in VB.NET and I have something that is eluding me.
If I want the text in txtgb1Age.Text to be placed into a word doc I normally do something like this
dim MyAge as string
MyAge = txtgb1Age.TEXT
.ActiveDocument.Bookmarks.Item("age").Range.Text = Microsoft.VisiualBasic.Format(MyAge, "##")
But I wanted to try and use the actual textbox as the varible this time and I don't understand why it returns "".
.ActiveDocument.Bookmarks.Item("age").Range.Text = Microsoft.VisiualBasic.Format(objfrmMain.txtgb1Age.Text, "##")
objfrmMain is dim as objfrMain as New FrmMain
What am I missing here?
Everything works fine as long as I create new variables but I would like to get away from that since I have had up to 50 public variables listed in a mod.
Also
The code above is listed in a module under a function called Print_WD_Document.
Thanks in Advance
If I want the text in txtgb1Age.Text to be placed into a word doc I normally do something like this
dim MyAge as string
MyAge = txtgb1Age.TEXT
.ActiveDocument.Bookmarks.Item("age").Range.Text = Microsoft.VisiualBasic.Format(MyAge, "##")
But I wanted to try and use the actual textbox as the varible this time and I don't understand why it returns "".
.ActiveDocument.Bookmarks.Item("age").Range.Text = Microsoft.VisiualBasic.Format(objfrmMain.txtgb1Age.Text, "##")
objfrmMain is dim as objfrMain as New FrmMain
What am I missing here?
Everything works fine as long as I create new variables but I would like to get away from that since I have had up to 50 public variables listed in a mod.
Also
The code above is listed in a module under a function called Print_WD_Document.
Thanks in Advance
Last edited: