J
Jose Ruben Gonzalez-Baird
I am trying to apply a function (wchich is contained in a module) to a button
in a user input form that will read the value in once field of the form and
convert that value to a different format in a different field in the form.
Here is the function that I am trying to apply:
Sub DegToDMS(ByVal L As Double, D As Integer, M As Integer, S As Double)
'
' Converts a decimal degree to Degrees, Minutes, and Seconds
' Seconds may contain up to 3 decimal places.
' e.g. 15.5 -> 15,30,0
'
D = Int(L)
L = (L - D) * 60
M = Int(L)
S = Val(Format((L - M) * 60, "#.###"))
End Sub
Ideally, the user can input a decimal degrees value in one field, then click
the button, which will display the degrees minutes seconds value in another
field. I have a fair sense of how to create the button, but not how to apply
the function to where it will read from the defined field and populate a
different field. If anyone has any pointers they would be much appreciated.
Thanks, Ruben.
in a user input form that will read the value in once field of the form and
convert that value to a different format in a different field in the form.
Here is the function that I am trying to apply:
Sub DegToDMS(ByVal L As Double, D As Integer, M As Integer, S As Double)
'
' Converts a decimal degree to Degrees, Minutes, and Seconds
' Seconds may contain up to 3 decimal places.
' e.g. 15.5 -> 15,30,0
'
D = Int(L)
L = (L - D) * 60
M = Int(L)
S = Val(Format((L - M) * 60, "#.###"))
End Sub
Ideally, the user can input a decimal degrees value in one field, then click
the button, which will display the degrees minutes seconds value in another
field. I have a fair sense of how to create the button, but not how to apply
the function to where it will read from the defined field and populate a
different field. If anyone has any pointers they would be much appreciated.
Thanks, Ruben.