If statement

punter

Registered User.
Local time
Today, 04:08
Joined
Nov 24, 2006
Messages
108
Hi,

I have a field in form named ETA Date. I would like that field to have a formula in it but I'm not sure exactly how to do it in Access.

The formula would be based off three other fields in the form. They are BOL Date, Port of Origin, and Port of Entry. I would like the formula in the ETA Date field add days the date in the BOL Date field depending on the Port of Entry and Port of Origin. Example:

BOL Date is 05-21-07
Port of Origin is Yanitan
Port of Entry is Newark

I have a table named tblTransitDays which has a breakdown of transit times depending on Port of Origin and Port of Entry. The header names in that table are Port of Origin, Port of Entry, and Transit Days.


So in this case I would want the formula in the ETA Date field to read that Port of Origin is Yanitan, the Port of Entry is Newark, and add 24 days to the BOL Date to give me a date of 06-14-07.

I hope I have explained myself correctly. I am looking around the forums right now to see if I can solve this. Any help is most welcome.

Thank you in advance for your time.

Eddie.
 
You can use the DateAdd function to do the math, and either a recordset or DLookup to get the number of days to add from the table.
 
Exactly... i dont know where my post went saying the same thing but its
dateadd("d",[#ofdaysfield],[BOL Date])
 

Users who are viewing this thread

Back
Top Bottom