CoachBarker
Well-known member
- Joined
- Jul 26, 2007
- Messages
- 133
- Programming Experience
- 1-3
I have an app that has a Main Form from which other forms are launched, frmPatientInfo is one. The frmPatientInfo launches another form, frmGlucoseLevels.
When I try to exit frmGlucose I get the following error.
This is the code for the exit
I have used this code in other apps and it works fine, but not here. Any suggestions.
Thanks
CoachBarker
VB.NET:
Private Sub btnGlucoseLevels_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGlucoseLevels.Click
Try
If frmMainScreen.Glucose Is Nothing Then
' let the base know we are opening the form
Dim ID As Int16 = intPatientID
frmMainScreen.Glucose = New frmGlucose(oLogin, ID)
frmMainScreen.Glucose.Show()
Else
frmMainScreen.Glucose.BringToFront()
End If
Catch ex As Exception
MessageBox.Show("An error occured in frmPatientInfo. Method: btnGlucoseLevels_Click. Error: " & ex.Message)
End Try
End Sub
When I try to exit frmGlucose I get the following error.
This is the code for the exit
VB.NET:
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Try
If hasChanged = False Then
Me.Close()
Exit Sub
End If
Dim yesNo As MsgBoxResult = MsgBox("Your changes have not been saved, " & _
"are you sure you want to exit?", MsgBoxStyle.YesNo, "Confirm Exit")
If yesNo = MsgBoxResult.Yes Then
Me.Close()
Exit Sub
End If
Me.Close()
Catch ex As Exception
MessageBox.Show("An error occured in frmGlucose. Method: btnExit_Click. Error: " & ex.Message)
End Try
End Sub
I have used this code in other apps and it works fine, but not here. Any suggestions.
Thanks
CoachBarker