I have 2 fields in a form
start date
End date
when the form is open i wish to have those fields automaticaly populated with the first and last day of the current month
Please - How do i get this result.
Good code, I hadn't seen that before. One thing I like to do with this kind of entry is put two buttons above the boxes to change months next and previous. The users love it.
I wrote the following on 2 buttons for next month and previous month
Next
Private Sub Command122_Click()
Me!BeginningDate = DateAdd("m", -1, [BeginningDate])
Me!EndingDate = DateAdd("m", -1, [EndingDate])
End Sub
Previous
Private Sub Command122_Click()
Me!BeginningDate = DateAdd("m", -1, [BeginningDate])
Me!EndingDate = DateAdd("m", -1, [EndingDate])
End Sub
If I start with 1/1/2006 and 31/1/2006
and click next it changes to
1/2/2006 and 28/2/2006
as one would expect
but when i click for next month again i get the following
1/3/2006 and 28/2/2006 not 31/3/2006
and each month remains at 28/4/2006 etc
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.