The BD for this test is really simple:
- 1 table: Placettes with 1 field: DATE_INV (format:Date, 2004-06-06 short format, no mask, no default value,)
- 1 form: Form1 to fill this table
I already have values in this tables.
I wrote this code at the OPEN EVENT of the form1:
Private Sub Form_Open(Cancel As Integer)
Me.DATE_INV.DefaultValue = Nz(DMax("[DATE_INV]", _
"Placettes", "[DATE_INV] <= #" & Date & "#"), Date)
End Sub
The result is a new date for each new record but it's 1905-05-31!!!
I really want to use this function and in
VB it seems easier than what I already did with macro. BUT it has to work...
Thanks
Patrica Molard