First off, let me provide you with my code:
Private Sub txtLatMin_Exit(ByVal Cancel As ReturnBoolean)
Dim i_SelStart As Long
Dim str_Prompt As String
'Save the cursor position.
i_SelStart = txtLatMin.SelectionStart
'Remove characters that we can't use.
txtLatMin.Text = NumericPortion(txtLatMin.Text, True)
'Enforce the maximums:
If Val(txtLatMin.Text) + Val(txtLatSec.Text) / 60 >= 60 Then
str_Prompt = "The maximum number of latitude minutes is 59.999."
MsgBox(str_Prompt, vbExclamation, "Notification")
Cancel = True
ElseIf Val(Me.textbox_Latitude_Degrees.Text) + Val(txtLatMin.Text) / 60 + Val(txtLatSec.Text) / 3600 > 89.99 Then
str_Prompt = "The maximum number of latitude degrees is 89.99."
MsgBox(str_Prompt, vbExclamation, "Notification")
Cancel = True
End If
'Restore the cursor position.
txtLatMin.SelectionStart = i_SelStart
End Sub
It is flagging the error in this post title at Cancel = True
Please keep in mind that I am converting code from VB6 to VB.NET
Would there be any suggestions that someone could provide me with?
I believe that you need to change
to