I need to figure out an event's starting date based on the last time the item was delivered.
For example, if an item is due monthly, there may be 40 previous deliveries, but I only want to find the last delivery date so I can add a month to that date for the current delivery.
My very first delivery has its due date calculated by getting the start date of the delivery or task order using DLookup, then calculating the due date through a SetDueDate function.
Code:
startDate = DLookup("Start_Date", "tblDeliveryTaskOrders", "Task_ID = " & Forms!frmDeliveriesReceived!frmDeliveriesReceived_Subform.Form!Delivery_Task_Order)
SetDueDate = FindDueDate(eventDue, startDate)
After it is delivered, the next delivery needs to get the previous delivery date from the delivery table with the same Relate_ID:
I have the following query (qryGetLastDelivered) to get the last date for each set of items:
Code:
SELECT tblDeliveriesReceived.Relate_ID, Max(tblDeliveriesReceived.Date_Due) AS [Total Of Date_Due]FROM tblDeliveriesReceived
GROUP BY tblDeliveriesReceived.Relate_ID;
So, how do I get the start date I need from the query results where
Code:
"Relate_ID = " & Forms!frmDeliveriesReceived!frmDeliveriesReceived_Subform.Form!Relate_ID)
Thanks in advance.