Does anyone here know an easy way to get two fields on an Access form to populate with the first day and last day of the previous month by the click of a button?
Here is the best I could come up with, but this seems so sloppy:
(of course, this is on the OnClick event on the button)
Dim TheDate As Date
Dim DaysBack As Integer
TheDate = Date 'uses TheDate so that I can enter any date for testing
DaysBack = (DatePart("d", (Date)))
[End] = (TheDate - DaysBack)
[Start] = (TheDate + 1) - (DaysBack + (DatePart("d", [End])))