C
Clancy
I have two text boxes in Access 2002-2003 that contain a date/time and I am
trying to apply a an IIf statement through their control source, but for some
reason they are not giving me the desired result. I can change the order of
my arguments, but usually only the first two work.
The first text box, which is [Date/Time 5] has the control source:
= IIf([Field 1]>="96" Or [Field 1]>"100",DateAdd("h",-[ Date/Time 1]-1,[
Date/Time 2]),IIf([Field 1]<"24",DateAdd("h",-[ Date/Time 1],[ Date/Time
2]),IIf([Field 1]<"96" And [Field 1]>="24",DateAdd("h",[ Date/Time 3],[
Date/Time 4]))))
The second text box, which is [Date/Time 2] has the control source:
= IIf([Field 1]>="96" Or [Field 1]>"100",DateAdd("h",96,[ Date/Time
4]),IIf([Field 1]<"24",DateAdd("h",24,[ Date/Time 4]), IIf([Field 1]<"96" And
[Field 1]>="24",DateAdd("h",[ Date/Time 1],[ Date/Time 5]))))
I had to put the >"96" and >"100" because for some reason without the >"100"
it would give an error with the number was over 100.
trying to apply a an IIf statement through their control source, but for some
reason they are not giving me the desired result. I can change the order of
my arguments, but usually only the first two work.
The first text box, which is [Date/Time 5] has the control source:
= IIf([Field 1]>="96" Or [Field 1]>"100",DateAdd("h",-[ Date/Time 1]-1,[
Date/Time 2]),IIf([Field 1]<"24",DateAdd("h",-[ Date/Time 1],[ Date/Time
2]),IIf([Field 1]<"96" And [Field 1]>="24",DateAdd("h",[ Date/Time 3],[
Date/Time 4]))))
The second text box, which is [Date/Time 2] has the control source:
= IIf([Field 1]>="96" Or [Field 1]>"100",DateAdd("h",96,[ Date/Time
4]),IIf([Field 1]<"24",DateAdd("h",24,[ Date/Time 4]), IIf([Field 1]<"96" And
[Field 1]>="24",DateAdd("h",[ Date/Time 1],[ Date/Time 5]))))
I had to put the >"96" and >"100" because for some reason without the >"100"
it would give an error with the number was over 100.