G
Guest
I have an Access aplication that currently uses the following code to
determine the previous week-ending date so it can copy some of the user's
input into a new record:
'assigns the datLastWeek variable to exactly one week before the pop-up
calendar selection for report's week-end date
datLastWeek = DateAdd("ww", -1, datWeekEndDate)
'assigns the datPrevWeekEnd variable to datLastWeek variable's week-ending
date (Saturday)
datPrevWeekEnd = DateAdd("d", (7 - Weekday(datLastWeek)), datLastWeek)
I NEED TO CHANGE THE CODE to find the most recent record. It doesn't matter
if it was a week ago or a month ago, just the date that's nearest the current
date. Do you have any suggestions on how I can do that?
determine the previous week-ending date so it can copy some of the user's
input into a new record:
'assigns the datLastWeek variable to exactly one week before the pop-up
calendar selection for report's week-end date
datLastWeek = DateAdd("ww", -1, datWeekEndDate)
'assigns the datPrevWeekEnd variable to datLastWeek variable's week-ending
date (Saturday)
datPrevWeekEnd = DateAdd("d", (7 - Weekday(datLastWeek)), datLastWeek)
I NEED TO CHANGE THE CODE to find the most recent record. It doesn't matter
if it was a week ago or a month ago, just the date that's nearest the current
date. Do you have any suggestions on how I can do that?