0

I'm trying to assign an instance of a Form to a Form Property

The system keeps showing an error at my second line of code below

Dim objFrm = New LsProg.SFile.frmTestRel(AddressOf sOpDos, AddressOf sOpDosLine, AddressOf sOpFac) 
_FavoriteForm.FrmInstance = objFrm
_FavoriteForm.FrmName = objFrm.Name
Tassisto
  • 9,235
  • 27
  • 93
  • 145

2 Answers2

1

You need to initialize _FavoriteForm before running this code.

Danieboy
  • 4,233
  • 6
  • 31
  • 53
1

If you get a NullReferenceException you need to think about what is actually Null and then go back and make sure you initialise it.

You told us

_FavoriteForm.FrmInstance = objFrm

threw this exception, so _FavoriteForm is clearly Null and needs to be initialised fist.

doctorlove
  • 18,125
  • 2
  • 46
  • 59