I can think of a couple of approaches. The first will store the information
as numbers, while the second will store the information as the resulting text
string:
For either of them, create a module with this public function in it:
Function DegreeConv(DecDeg As Double) As String
Dim Deg As Integer
Dim DecMin As Double
Dim Min As Integer
Dim Sec As Integer
Deg = Int(DecDeg)
DecMin = (DecDeg - Deg) * 60
Min = Int(DecMin)
Sec = Round((DecMin - Min) * 60, 0)
DegreeConv = Str(Deg) & Chr(186) & " " & Str(Min) & "' " & Str(Sec) & """"
End Function
1. Just store the decimal degrees and have the function run when you want to
see one of them in the proper format (e.g. when displaying on a form or in a
report), since I do not believe that there is a standard format for storing
angles or lat/long values. If you have a form that has two boxes: DecDeg and
Latitude, this code will correctly populate Latitude from the DecDeg.
Private DecDeg_AfterUpdate()
Latitude = DegreeConv(DecDeg)
End Sub
2. Store the resulting text string. To do this one, I started with a VERY
simple table called Degrees. It has only two fields: DecDeg (Number, Double)
and Latitude (Text). Create a few records with entries in DecDeg but leave
Latitude blank.
Now create a new query, go to SQL view, and past this into it:
UPDATE Degrees SET Degrees.Latitude= DegreeConv([DecDeg]);
When you run the query, it will update the latitude field to match the
decimal degrees.
The only drawback is that the data is stored as a string, not as a number.
You may wish to store both, as in my simple example, so that you can use the
numeric value in calculations, but the latitude string when displayed for
users.