Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional Due Date Calculation Problem

Status
Not open for further replies.

bruch04

Technical User
Mar 12, 2004
9
US
Okay. In my company, we get forms faxed in describing adverse medical events. These forms are updated and faxed in whenever new information about the event becomes available. Whenever we receive a fax, I have either 3 days or 7 days, depending on whether the event was fatal or not, to draft a narrative to hand in. The fields I have so far are: Initial report date, Follow-up #1 date ... Follow-up #8 date, Fatal (meaning 3 day narrative), Due Date. Note: Fatal is a yes/no field.

Problem: I want the due date calculated on a) the date the fax comes in and b) whether it's a 3 day or a 7 day affair.

I've been working on nested IIf statements and DateAdd expressions and have been coming up with errors left right and center. The closest I came was:

=IIf ([Follow-up #1]) = Null, (IIf ([Fatal]) = true, DateAdd("d",3, [Initial Report Date]), DateAdd("d", 7, [Initial Report Date])),(IIf ([Fatal]) = true, DateAdd("d",3, [Follow-up #1]), DateAdd("d", 7, [Follow-up #1]+7)))

...then I need to continue with the same pattern so it will check follow-up2 Date, and if it's blank to use the follow-up 1 date and so on....

Is this calculation even possible? Or am I making this just way too complicated? ***ANY*** help would be greatly appreciated. Thanks.

 
if I understand what you are trying to do this should be close

=dateadd("d",IIf([fatal]=true,3,7),[Initialreportdate])
can test for null if desired
 
i dont really get what you want.but i think its similar to this (hope so)
create a box in your form,name it "current record"
Type this in the box> =time()+3 *this means that current date plus 3 days. (dont forget to set the format)
for seven day =time()+7
or you can also make the date start calculating only on the day you add the record by > Properties, choose >Value and typr =date()+3 or =date()+7
it will apeear as the seven days after the current date.
thats for the date.I think i can solve your other problem by using queries, but please make me understand more. idint really understand.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top