Forum Discussion
nicoleethier
May 21, 2026Brass Contributor
Access selecting specific date on a calendar
I'm pulling my hair out because everything I've found through my research says my VBA code should work, but it doesn't! Here's the story. I have a calendar (form) that shows events going on for each...
GustavBrock
May 21, 2026MVP
You are making it way too complicated. Try:
Private Sub lblTue3_Click()
Dim SelectDate As Date
SelectDate = DateValue(Me!txtSelectDate.Value)
DoCmd.OpenForm "frmThatContainsMyData", acNormal, , "[DateOnFormUsedForFilter] = #" & Format(SelectDate, "yyyy\/mm\/dd") & "#", , acDialog
End Sub
' or even:
Private Sub lblTue3_Click()
DoCmd.OpenForm "frmThatContainsMyData", acNormal, , "[DateOnFormUsedForFilter] = #" & Me!txtSelectDate.Value & "#", , acDialog
End Sub
nicoleethier
May 27, 2026Brass Contributor
Thank you for your quick reply and help! I'm sure you are right in that I'm making this more complicated than it needs to be. Unfortunately, I tried both codes and neither worked. I suspect it has something to do with the rest of the code I used to create the calendar; I'll post it in a reply along with some pictures of the layout.