Can't read a textbox on frmMain from a module.

  • Thread starter Thread starter Mugsy_in_Houston
  • Start date Start date
M

Mugsy_in_Houston

Guest
If trying to read the contents of a textbox on frmMain for use in a Module:

If My.Computer.FileSystem.DirectoryExists(frmMain.txtPrefix.Text & strSrcFldName) Then...

The line does not produce an error at design time nor crash the program when run, but when executed, the result is always False and when I put a Breakpoint & watch on "frmMain.txtPrefix.Text", VS reports the value as:

error BC30469: Reference to a non-shared member requires an object reference.

Clearly, I've referenced the objects. The code did not cause an error when it was on the original form (I'm moving it to a Public Sub in a Module so it can be reused.) I'm not sure what to do to fix this. I remember long ago being able to reference the contents of remote forms this way.

TIA

Continue reading...
 
Back
Top