Nov 08 2021 05:52 PM
Hello, I have a form and fills in fields based on which button I press.
One of the buttons fills fields as below with current date and I am having an issue populating the field that is the end of the year (Me.txtDateTo).
Please let me know where I am wrong.
Thank you
Private Sub cmdyear_Click()
Me.txtdatefrom = Date
'doesnt work in VBA: Me.txtDateTo = DATE(YEAR(TODAY()),12,31)
' doesnt work: Me.txtDateTo = DateAdd("yyyy", 1, Date)
End Sub
Nov 08 2021 06:42 PM
What does it mean to say "it doesn't work"?
What are you expecting the result to be? What is the actual result? How are they different?
Sometimes what is clear to the person looking at the Access database is not clear to anyone who can't see it.
Nov 09 2021 03:14 AM
Nov 09 2021 06:43 AM
@Tony2021 "...The examples I provided did not work. "
Again, what does that mean? Errors? Wrong values? Describe the behavior, not the outcome. That's where we can spot clues to what might be wrong.
Nov 10 2021 06:37 AM
Solution