line of code causing me problems

cdoverlaw

Well-known member
Joined
Oct 11, 2003
Messages
146
Hi
I need my program to get a password from a textbox on another form, I am currently trying to use this line of code:
Code:
epassword = frmOptions.txtEncryptPass.Text
but i get the error
Code:
An unhandled exception of type System.NullReferenceException occurred in WHM_cPanel_Launcher.exe

Additional information: Object reference not set to an instance of an object.

Jonathan
 
DId you create an instance of the options form? Its not like VB6 anymore, you cant do that any more.

Earlier:
Code:
dim frmOptionsInstance as new frmoptions

then your part:
Code:
epassword = frmOptionsInstance.txtEncryptPass.Text
 
As i had created an instance of the form already on my main form )(first to be opened) i just have the line
Code:
Dim frmOptions As frmOptions
 
Ok, i just found out you were right, weird i didnt think that would be a problem, anyway thanks,
 
Back
Top