calendar
2 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 Update: I think I figured out where the problem is. When the calendar form is loaded, that's where txtSelectDate is defined. However, I don't know how to define txtSelectDate to whatever date I click on in the calendar. It defaults to today's date when I load the form. When I change the month or year, those number change in the txtSelectDate box, but not the day. This is the code I currently have. (DisplayMonthName displays the month and year; don't think it's part of my issue) Private Sub Form_Load() Me.txtSelectDate = Date Call DisplayMonthName End Sub Any help is greatly appreciated!195Views1like11CommentsConnecting MS Access to MS Outlook Calendar - MS Outlook calendar to automatically generate event
In short, I am building a holiday planner, which all the employees within my department are to use. I want to build such functionality in MS Access that, whenever I have approved a holiday, i.e. the approved time period goes into table X, Columns Y and Z, which columns are date columns. I want to extract the time period columns Y and Z form and automatically generate an event in the MS Outlook calendar, which states the employee name from the employee table and the time period they are to be absent. For this I need MS Outlook to extract the data from MS Access. Do you guys have a suggestion how this may happen? P.s. Also I want the calendar I made in MS Outlook to check the table once every 24h and for every new row in table X I want it to create a new event automatically and delete the relevent event if the row is delete1.4KViews0likes1Comment