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
  • 8,589
  • 27
  • 91
  • 140

2 Answers2

1

You need to initialize _FavoriteForm before running this code.

Danieboy
  • 4,033
  • 5
  • 29
  • 49
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
  • 17,477
  • 2
  • 41
  • 57