Well bummer! I'd been searching everywhere for a data type to store this
information. As we live in a 3D world you would have thought that the bright
boys at Microsoft would have come up with a data type for storing "polar"
coordinates ... but then I guess that a crt monitor projection is only in 2D.
Still, a lot of modern games process 3D geometry...
So ... what is the data going to be used for? Well, it will be input by the
user, so it needs a friendly input Form. Secondly, it will be displayed on
the screen whenever the user selects an airport, so it needs to be formatted
as text. Finally, it will be used mathematically to calculate the distance
between two airports, so I'll need to convert it to a number.
Here's what I propose. I like Fred's idea of storing it as a simple text
field. I'm thinking of a format that is quick and easy to enter, say,
-34d56'25.8". The minus (-) will cover South for latitude and West for
longitude. When the user selects OK, I'll parse the string and replace the
degrees (d) with the ° character and replace the minus (-) with S or W as
required, so that it displays correctly: 34°56'25.8" S. I've just checked
and the Text data type will hold the ° character. That way the data will be
stored in a format that matches the way we typically see it in real life.
The downside of your suggestion is that searching for text strings requires
either ' or " as a string delimiter; strings including either ' or " are
harder to search, and strings containing BOTH delimiters - as you suggest -
are hardest of all. It can be done but it's a PITA.
The four fields idea is not quite as bad as you postulate. You can have four
textboxes (actually a List of Values combo for NS) cheek by jowel on the form,
and have the tab order and input masks and AutoTab properties set so that you
can simply type 0345625.8S (without any tabs or punctuation other than the
period) to enter all of the values. You could use either four table fields and
bound textboxes, or (my preference) unbound textboxes and a separate,
invisible, bound textbox bound to a Single or Double number field, with code
to parse the numbers into a numeric value (and corresponding code in the
form's Current event to parse the number into the four textboxes.
One advantage of this would be that you could do validity checking in the
parsing so that users couldn't enter suspect data such as 42d84'93"S.