BLACK FRIDAY SALE IS LIVE.
GET OUR PROFESSIONAL VBA TEMPLATES (UpTo 65% Discount) Click here
GET OUR PROFESSIONAL VBA TEMPLATES (UpTo 65% Discount) Click here
MS Access by default provides inbuilt functionality to pick dates using calendar control; however it lacks few basic functionalities which makes selecting a date bit difficult. For example, if you want to select a date from year 2015 then you need to navigate multiple times to select correct date since you can move only one month at a time in MS Access calendar control. Looking at this common challenge, I have developed a custom calendar control in MS Access form which makes selection of date much easier
1. Save the following attachment in your system Custom Calendar Control
2. Open the MS Access tool where you want to use this calendar control
3. Select Access from External Data menu
4. Browse the file which you have downloaded and click on OK button
5. Under Forms tab select Calendar and click on OK
6. You will receive a confirmation message once import is complete, click on Close to proceed
7. Now the Custom Calendar Control is ready to use. To use it on the existing form (here it is Form1), open the form in design mode
8. Add a command button adjacent to the text box control where you want to show the selected date
9. Change the following properties of Command Button
Width: 0.3
Caption: Blank
Name: cmdSelectDate
10. In the Picture property of Command Button, select calendar
11. Create an On Click Event Procedure of Command Button
12. Click on ‘…’ to create the procedure in VBA screen
13. Add the following code in the click event procedure
DoCmd.OpenForm "Calendar", acNormal
If IsDate(txtDate.Value) = True Then
Form_Calendar.LoadCalendarForm txtDate.Value
Else
Form_Calendar.LoadCalendarForm
End If
Form_Calendar.lblFormName.Tag = Me.Name
Form_Calendar.lblControlName.Tag = "txtDate"
Note: In the above code txtDate is the control name where the selected date will be displayed. In your tool if this control name is different, you can replace the same in above code.
14. Done, save your project and open the form
15. Click on the Calendar button to select a date
Hope you liked this article. Please share it with your colleagues and comment your views below.
VBA to Read Excel Data Using Connection String Sometimes as a programmer you need to read heavy (more then 5 MB) Excel files. There are two ways you can read data from Excel files: Open…
VBA Code to list Files in Folder To work on multiple files through VBA programming, you need to have VBA code that can list files in a folder. Here is a simple code for you,…
How to send bulk emails from outlook using excel VBA? Have you ever felt the need of an Excel based VBA tool or code which can help you to draft Outlook emails in bulk by…
How to Add Outlook Reference in Excel VBA? To automate Outlook based tasks from Excel you need to add Outlook Object Library (Microsoft Outlook XX.X Object Library) in Excel References. You can follow below steps…
VBA code that will sum cells by its color through excel function. This code will really help in making the analysis and presentation better.
What is the Usage of sheet color in Excel? When we prepare a report or a dashboard it is easy to identify or analyze reports with a change of color sheet tabs. Analysts generally give…