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,877
  • 28
  • 100
  • 157

2 Answers2

1

You need to initialize _FavoriteForm before running this code.

Danieboy
  • 4,393
  • 6
  • 32
  • 57
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,872
  • 2
  • 46
  • 62