Adding Calculated Controls in Queries

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

Guest

I have a query that has a seperate form used for entering data. I am having
problems adding calculated controls and I will try to explain what I have set
up the best I can.
First, I have a list box that is the total number of hours for a maintenance
action that is calculted from two other list boxes with a start and end DTG.
I then have 5 list boxes that calculate a possible 5 delays in maintenance
from 5 sets of start and end DTG list boxes. I then have a list box that
calculates the total delay time from the 5 possible delay scenerios.
Finally, I have a list box that calculates total maintenance time by
subtracting the total delay time from the total number of hours for the
maintenance action.
I have problems when I have more than one delay time or no delay times at
all. When I have more than one delay time it enters all the different delay
times in the total delay time list box and gives me a #Error for the total
maintenance time box. If there are no delays then I also get a #Error in the
total maintenance time box. The only time I get accurate calculations is if
there is only 1 delay. I hope I explained this well enough that someone can
please help me.

Cheers,
Keith
 
This may help you to help me:
This is the code I have for total number of hours for a maintenance action-
Outage Duration: Round(IIF([Repaired DTG] Is Null.DateDiff("n" , [Failed
DTG], Now ()), DateDiff ("n", [Failed DTG], [Repaired DTG]))/60,2))

This is the code I have for calculating the individual delay times-
Duration 1: Nz(Round(IIF([End Delay DTG 1] Is Null.DateDiff("n" , [Start
Delay DTG 1], Now ()), DateDiff ("n", [Start Delay DTG 1], [End Delay DTG
1]))/60,2))

This is the code I have for calculating total delay time-
Total Delay Time: ([Duration 1]+[Duration 2]+[Duration 3]+[Duration
4]+[Duration 5])

This is the code I have for calculating total maintenance time-
Total Maintenance Time: ([Outage Duration])-([Total Delay Time])

Hopefully that helped.

Cheers,
Keith
 
Back
Top