PeterErhard
asked on
MDI form Error
I'm getting the following error occasionally when I load my initial MDI form:
"Object reference not set to an instance of an object".
It happens on the following line of code:
frmMain.ActiveForm.Text = "Centre : " & BranchName & " (" & UserCentre & "); User: " UserFullName & " (" & LCase(Username) & ")"
It doesn't happen all the time the application is loaded which makes it very hard to figure out why the eroror is occuring. Does anyone have any ideas?
"Object reference not set to an instance of an object".
It happens on the following line of code:
frmMain.ActiveForm.Text = "Centre : " & BranchName & " (" & UserCentre & "); User: " UserFullName & " (" & LCase(Username) & ")"
It doesn't happen all the time the application is loaded which makes it very hard to figure out why the eroror is occuring. Does anyone have any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for that - appears to have worked!
frmMain.ActiveForm.Text = "Centre : "
frmMain.ActiveForm.Text = frmMain.ActiveForm.Text + BranchName
frmMain.ActiveForm.Text = frmMain.ActiveForm.Text + " (" + UserCentre
.... etc
to find out which variable isnt getting initialised properly.