M
myxmaster
Thanks to Databasedev.co.uk I have the following code. However for
some reason the month portion does not work. Any ideas.
Private Sub cmdmonth_Click()
'Sets the Date From and Date To text boxes
'to show complete month (from start to end of current month)
Me!txtdatefrom = CDate("01/" & Month(Date) & "/" & Year(Date))
Me!txtDateTo = DateAdd("d", -1, DateAdd("m", 1, Me!txtdatefrom))
End Sub
Private Sub cmdyear_Click()
'Sets the Date From and Date To text boxes
'to show complete current year
Me!txtdatefrom = CDate("01/01/" & Year(Date))
Me!txtDateTo = DateAdd("d", -1, DateAdd("yyyy", 1, Me!
txtdatefrom))
End Sub
some reason the month portion does not work. Any ideas.
Private Sub cmdmonth_Click()
'Sets the Date From and Date To text boxes
'to show complete month (from start to end of current month)
Me!txtdatefrom = CDate("01/" & Month(Date) & "/" & Year(Date))
Me!txtDateTo = DateAdd("d", -1, DateAdd("m", 1, Me!txtdatefrom))
End Sub
Private Sub cmdyear_Click()
'Sets the Date From and Date To text boxes
'to show complete current year
Me!txtdatefrom = CDate("01/01/" & Year(Date))
Me!txtDateTo = DateAdd("d", -1, DateAdd("yyyy", 1, Me!
txtdatefrom))
End Sub