DMax() and recordset?

Malcy

Registered User.
Local time
Today, 19:50
Joined
Mar 25, 2003
Messages
586
I am adding records to a recordset using DateAdd. The records need to be added at weekly, fortnightly, or four weekly intervals.
I have managed to get it sort of working using "ww" as the interval, a variable intInterval to say whether it is 1, 2 or 4 weeks to add, but I somehow need to find a way of getting the date of the previously added record in order to get the DateAdd function to append, for instance, fortnightly dates.
I tried DMax("dtmSupDate") -i.e. the date field that is getting appended within the recordset - but that gets thrown out in the compile.
I also tried DMax("dtmSupDate", "tblTmpSS") on the basis that tblTmpSS is the table which the recordset is based upon but that didn't work either.
I am sure there is probably a fairly standard way of getting the value for the date part of the DateAdd() function but am currently stuck.
Any suggestions?
Thanks

Malcy
 
Why can't you either use the current date or use your DMAX function to return the date, store that in a date variable and use that in your insert? You can just bump it up and keep using it if you need to.

Dim MyDate as date
MyDate = (now() or date returned from table etc)

Then you can use the MyDate variable in a DATEADD and store the modified date (or use two variables if you are more comfortable with that).
 

Users who are viewing this thread

Back
Top Bottom