RE: Calculating with several fields

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You're welcome. Glad I can be of help for a change. :)

I'm pretty new to Access programming, too, so I'm not aware of an onlline
"dictionary" for all the VB/VBA functions. (Maybe someone else knows?) What
I do if I see a function I'm unfamiliar with is bring up the Access
expression builder, find it in the "All" list, and then hit F1 to call-up
Access Help. If the help is cryptic (and it often is), I'll do a search here
for it and will often find alot of good info. Finally, if that doesn't solve
it, I ask the question here and get tons of help. :D

Regards, Chris


"bob" wrote:

Chris thank you for the help
the calculation works great. After i wrote this i figured it out with the Nz
sign.

here is a easy question the there anywhere on the net that has all the sign
or what ever they are called. I do know that there is different letters for
different purposes.
Iam kind of new at this.

"Chris O''''Neill" wrote:

If I'm understanding your question correctly, you want to know how to make
sure a NULL field won't blow-up your calculations? That would be the NZ()
function:

NZ(fieldname,what-to-replace-NULL-with)

For instance:

NZ(Me.TotalTime,0) will put a zero in the TotalTime field if it is NULL.
So...

Me.Rate * Me.TotalTime will result in an error if TotalTime is NULL, but
Me.Rate * NZ(Me.TotalTime,0) will result in zero if TotalTime is NULL

Hope that helps...

Regards, Chris

P.S. Your calculations are wrong. The Total Tie for the middle column
should be 45 minutes, and the total time for the far right column should be 1
hour. Ya got the first column right, though! ;) :D

"bob" wrote:

The postings that i did get for time worked great. Now the issue is that i
want to link the fields together so it will calculate all the mons that are
left and pay a rate to that time. I have that part, that is take that field
and times it by a number. so here is what it looks like

Time IN 12:00:00 pm Time In 12:00:00pm Time In 12:00:00
Time out 13:00:00 pm Time out 13:30:00 pm Time out 13:45:00 pm
Delay Time 45 Delay Time 45 Delay Time 45
Total Time 15 Total Time 30 Total Time 45

now what i need to do is to add them up and if there is is not one that has
anything in it that is will still calculate it. Meaning that if 1 and 2 are
filled or just one is filled it will still calculate or add it up. I know
that their need to be fields for the toal time and the pay. what i need is
what to put for the null factor. if more info is need please ask

Thank you for your time
.



Relevant Pages

  • RE: Calculating with several fields
    ... Chris thank you for the help ... sure a NULL field won't blow-up your calculations? ... NZ(Me.TotalTime,0) will put a zero in the TotalTime field if it is NULL. ... that their need to be fields for the toal time and the pay. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Keeping and caculating historically correct data?
    ... > employee through a certain date.... ... results and delete the elements of the calculations. ... > corresponding rate for each day in the pay period. ...
    (comp.programming)
  • Re: Negotiated fee rate
    ... Are they hiding the relatively low rates from the uninsured? ... >>have to pay a bill without the evidence of the calculations used? ... > held close to the vest by the insurer. ...
    (talk.politics.medicine)
  • Re: simple formatting
    ... Once in the new number fields i will do the calculations ... a Number or Currency datatype field. ... data, then you will have unending problems with calculations, with data ... Your choice - pay now, ...
    (microsoft.public.access.formscoding)
  • Re: simple formatting
    ... Once in the new number fields i will do the calculations ... a Number or Currency datatype field. ... data, then you will have unending problems with calculations, with data entry, ... Your choice - pay now, ...
    (microsoft.public.access.formscoding)