On Dec 28, 12:12 pm, golan wrote:
> i need that the function add it to the last month
> --
> golani
If the PaymenDate column is a true date/time data type then use:
=Format(DateAdd("m",1,DMax("PaymentDate", "Payments", "CustomerID = "
& [CustomerID])),"mm/yy")
If the last payment is stored in a text field in the table in a format
mm/yy then use the following as the ControlSource of a text box on
your form:
=Format(DateAdd("m",1,DMax("DateSerial(Right(PaymentDate,2),Left
(PaymentDate,2),1)","Payments","CustomerID = " & [CustomerID])),"mm/
yy")
where Payments is the table name, PaymentDate is the name of the text
column containing the payment dates in mm/yy format, and CustomerID is
a foreign key column of number data type identifying the customer.
Ken Sheridan
Stafford, England
>> Stay informed about: date manipulation