vba
18 TopicsAccess 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 month. What I want is for a person to click on a specific day and have a pop-up form appear showing more details of the events for whatever day they clicked on. I used the below code, which mostly works... When I click on a date, the month and year will be correct, but not the day of the month. The day of the month is always today's day. For example, let's say I click on the day Feb. 2, 2024 and today's date is May 21, 2026. My pop-up form will show the events for Feb. 21, 2024. This is the code I have: Private Sub lblTue3_Click() Dim txtSelectDate As Date (probably don't need this) Dim iDayOfMonth As Integer Dim iMonth As Integer Dim iYear As Integer Dim dSelectDate as Date iDayOfMonth= Format(Me.txtSelectDate.Value, "d") iMonth = Format(Me.txtSelectDate, "mm") iYear = Format(Me.txtSelectDate, "yyyy") dSelectDate = CDate(iMonth & "/" & iDayOfMonth & "/" & iYear) DoCmd.OpenForm "frmThatContainsMyData", acNormal, , "[DateOnFormUsedForFilter]=#" & dSelectDate & "#", , acDialog Instead of Format, I've tried using the code Day(Me.txtSelectDate), but that didn't work either. It always defaults to the day of the month that's today. Can anyone tell what I'm doing wrong? I've checked the formatting, and everything is set to 'Short Date'... I'm just at a complete loss! Any help is greatly appreciated!23Views1like0CommentsRecovering a VBA protect password
I wrote a database in 2009/2010 in 2007. I migrated it to 2010, changed it to an accdb and password protected the VBA. In 2017, I left the company, handed over all of my passwords, and left my code in another's hands. In Sept 2021, they asked me to please come back, I did, and the password to the DB I am trying to recover was lost. I have tried using HxD, which doesn't work with accdb. How can I recover the password?10KViews1like5Comments