-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontrol.bas
More file actions
80 lines (63 loc) · 2.5 KB
/
Copy pathcontrol.bas
File metadata and controls
80 lines (63 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Attribute VB_Name = "Control_Mod"
Public Sub ClearTextBoxes(frmClearMe As Form)
'**************************************
'Clears all the TEXT Boxes on the form
'**************************************
Dim txt As Control
'clear the text boxes
For Each txt In frmClearMe
If TypeOf txt Is TextBox Then txt.Text = "00"
Next
End Sub
Public Sub eofbof(rs As ADODB.Recordset)
'Monitors the Errors for BOF / EOF
If rs.EOF = True Then
rs.MoveLast
Else
If rs.BOF = True Then
rs.MoveFirst
End If
End If
End Sub
Public Function mMsgBox(str As String)
'My Message Box Function for Error Handling
MsgBox str, vbCritical, "Error Handler"
' & Chr(10) & Chr(10) & "- More Information -" & Chr(10) & _
' Chr(10) & "Error Number :" & Err.Number & Chr(10) & Chr(10) & _
' "Error Description: " & Err.Description
End Function
Public Sub errHandler()
With Form1
'Check if the Values are Numeric or Not...?
If Not IsNumeric(.txtdeg_lat1.Text) Or Not IsNumeric(.txtDeg_lat2.Text) Or _
Not IsNumeric(.txtdeg_long1.Text) Or Not IsNumeric(.txtDeg_long2.Text) Or _
Not IsNumeric(.txtmin_lat1.Text) Or Not IsNumeric(.txtMin_lat2.Text) Or _
Not IsNumeric(.txtmin_long1.Text) Or Not IsNumeric(.txtMin_long2.Text) Or _
Not IsNumeric(.txtsec_lat1.Text) Or Not IsNumeric(.txtSec_lat2.Text) Or _
Not IsNumeric(.txtsec_long1.Text) Or Not IsNumeric(.txtSec_long2.Text) Then
mMsgBox "Only Numbers Allowed."
ClearTextBoxes Form1
End If
End With
'Small Error Handler - Checks for Input-ted values only
With Form1
If (.txtdeg_lat1.Text Or .txtDeg_lat2.Text Or .txtdeg_long1.Text Or _
.txtDeg_long2.Text) > 99 Then
mMsgBox "Please Enter the Degree Part Only..." & Chr(10) & _
Chr(10) & "Only 2-Digits Allowed"
ClearTextBoxes Form1
End If
If (.txtmin_lat1.Text Or .txtMin_lat2.Text Or .txtmin_long1.Text Or _
.txtMin_long2.Text) > 99 Then
mMsgBox "Please Enter the Minute Part Only..." & Chr(10) & _
Chr(10) & "Only 2-Digits Allowed"
ClearTextBoxes Form1
End If
If (.txtsec_lat1.Text Or .txtSec_lat2.Text Or .txtsec_long1.Text Or _
.txtSec_long2.Text) > 99 Then
mMsgBox "Please Enter the Second Part Only..." & Chr(10) & _
Chr(10) & "Only 2-Digits Allowed"
ClearTextBoxes Form1
End If
End With
End Sub