A function that enters its Results

J

JSF

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?
 
R

Rick B

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
 
R

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
 
P

Peter De Baets

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top