A function that enters its Results

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 3 fields: Deg, Min, Sec. I want to create a function that would enter
the result into a 4th field called DecDeg. The calculation is DecDeg = Deg
+ (Min/60)+(Sec/3600). How can I do this?
 
Why do you need a function?

Just add an unbound text box to your form and put in the formula you list...

= Deg + (Min/60)+(Sec/3600)


Rick B
 
No.

You don't store calculated results in a table. That is redundant. It is
not in keeping with proper database design.

When you need the result in a query, form, or table, simply calculate it.

Rick B
 
function fGetDecDeg(deg as single, min as single, sec as single) as single
fGetDecDeg = Deg + (Min/60)+(Sec/3600)
end function

Then use it like so:

DecDeg = fGetDecDeg(Deg, Min, Sec)

Hope this helps,

Peter De Baets
Peter's Software - MS Access Tools For Developers
http://www.peterssoftware.com
 
Back
Top