If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Date Picker
Hello,
Is there a VBA method to bring up a calander without having to click the DatePicker icon for a date control? Thank you and God Bless, Mark A. Sam |
#2
|
|||
|
|||
Date Picker
Not sure of exactly what you have in mind, but here's a routine that I use:.
If you'd like to only have the DatePicker appear when you need to pick a date, you can use this routine. YourTextBoxName is the name of the box that will hold the date YourDatePickerName is the name of your DatePicker. First, place the DatePicker where you want it to appear on the form. Next, select the DatePicker and goto Properties--Format and set Visible = No Then place this code in the form's code module: Private Sub Form_Load() YourDatePickerName = Date End Sub Private Sub YourTextBoxName_DblClick(Cancel As Integer) YourDatePickerName.Visible = True End Sub Private Sub YourDatePickerName_Click() YourTextBoxName = YourDatePickerName YourTextBoxName.SetFocus YourDatePickerName.Visible = False End Sub Now, when your user DoubleClicks on the textbox where the date will go, the DatePicker will appear. The date is picked, and the DatePicker disappears! -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200801/1 |
#3
|
|||
|
|||
Date Picker
Linq,
Are you talking about an ActiveX control named "DatePicker"? I am referring to the Datepicker that is built into a Textbox linked to a date field in Access 2007. When the field gets the focus, an icon appears and the calendar pops up. There is a property for the textbox called, ShowDatePicker with options, "For Dates" and never. If there was a third choice, "Always" that would solve my issue. If a user clicks on the textbox, he has to then click on the icon. I want to bypass that step so that if he click on the control, the Calendar pops up immediately. I don't now if that makes sense, but I just want to bring up the calander with one click rather than two. God Bless, Mark "Linq Adams via AccessMonster.com" u28780@uwe wrote in message news:7d9f5eaf24480@uwe... Not sure of exactly what you have in mind, but here's a routine that I use:. If you'd like to only have the DatePicker appear when you need to pick a date, you can use this routine. YourTextBoxName is the name of the box that will hold the date YourDatePickerName is the name of your DatePicker. First, place the DatePicker where you want it to appear on the form. Next, select the DatePicker and goto Properties--Format and set Visible = No Then place this code in the form's code module: Private Sub Form_Load() YourDatePickerName = Date End Sub Private Sub YourTextBoxName_DblClick(Cancel As Integer) YourDatePickerName.Visible = True End Sub Private Sub YourDatePickerName_Click() YourTextBoxName = YourDatePickerName YourTextBoxName.SetFocus YourDatePickerName.Visible = False End Sub Now, when your user DoubleClicks on the textbox where the date will go, the DatePicker will appear. The date is picked, and the DatePicker disappears! -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200801/1 |
#4
|
|||
|
|||
Date Picker
Sorry! You really need to ***always*** include the fact that you're running
2007 when posting a thread! The differences between 2007 and all previous versions are so great! Don't have a clue since it's 2007. You desire to have only one click to bring up the calendar is more than reasonable! Since the entire purpose of using a calendar is to facilitate the easy, accurate entry of dates, common sense would dictate that if the developer chose to have one pop up, it would do so when the field was entered! If I use a calendar, it means I don't want my users to input the date manually! But, of course, we're talking about Micro $oft! Maybe someone who's using 2007 has a workaround. Good Luck! -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000/2003 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200801/1 |
#5
|
|||
|
|||
Date Picker
Hi Mark,
Just use this code when the control gets focus: DoCmd.RunCommand acCmdShowDatePicker -- Jeff Conrad - Access Junkie - MVP Alumni SDET - XAS Services - Microsoft Corporation Co-author - Microsoft Office Access 2007 Inside Out Presenter - Microsoft Access 2007 Essentials http://www.accessmvp.com/JConrad/accessjunkie.html Access 2007 Info: http://www.AccessJunkie.com ---------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.mspx ---------- "Mark A. Sam" wrote in message: ... Are you talking about an ActiveX control named "DatePicker"? I am referring to the Datepicker that is built into a Textbox linked to a date field in Access 2007. When the field gets the focus, an icon appears and the calendar pops up. There is a property for the textbox called, ShowDatePicker with options, "For Dates" and never. If there was a third choice, "Always" that would solve my issue. If a user clicks on the textbox, he has to then click on the icon. I want to bypass that step so that if he click on the control, the Calendar pops up immediately. I don't now if that makes sense, but I just want to bring up the calander with one click rather than two. |
#6
|
|||
|
|||
Date Picker
That's what I wanted. Thanks Jeff.
"Jeff Conrad [MSFT]" wrote in message ... Hi Mark, Just use this code when the control gets focus: DoCmd.RunCommand acCmdShowDatePicker -- Jeff Conrad - Access Junkie - MVP Alumni SDET - XAS Services - Microsoft Corporation Co-author - Microsoft Office Access 2007 Inside Out Presenter - Microsoft Access 2007 Essentials http://www.accessmvp.com/JConrad/accessjunkie.html Access 2007 Info: http://www.AccessJunkie.com ---------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.mspx ---------- "Mark A. Sam" wrote in message: ... Are you talking about an ActiveX control named "DatePicker"? I am referring to the Datepicker that is built into a Textbox linked to a date field in Access 2007. When the field gets the focus, an icon appears and the calendar pops up. There is a property for the textbox called, ShowDatePicker with options, "For Dates" and never. If there was a third choice, "Always" that would solve my issue. If a user clicks on the textbox, he has to then click on the icon. I want to bypass that step so that if he click on the control, the Calendar pops up immediately. I don't now if that makes sense, but I just want to bring up the calander with one click rather than two. |
#7
|
|||
|
|||
Date Picker
No problem, glad to help.
-- Jeff Conrad - Access Junkie - MVP Alumni SDET - XAS Services - Microsoft Corporation Co-author - Microsoft Office Access 2007 Inside Out Presenter - Microsoft Access 2007 Essentials http://www.accessmvp.com/JConrad/accessjunkie.html Access 2007 Info: http://www.AccessJunkie.com ---------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.mspx ---------- "Mark A. Sam" wrote in message: ... That's what I wanted. Thanks Jeff. |
#8
|
|||
|
|||
Date Picker
Jeff,
I implemted this and on the first trial of the app, the user remarked that she liked it. Thanks again. God Bless, Mark "Jeff Conrad [MSFT]" wrote in message ... No problem, glad to help. -- Jeff Conrad - Access Junkie - MVP Alumni SDET - XAS Services - Microsoft Corporation Co-author - Microsoft Office Access 2007 Inside Out Presenter - Microsoft Access 2007 Essentials http://www.accessmvp.com/JConrad/accessjunkie.html Access 2007 Info: http://www.AccessJunkie.com ---------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.mspx ---------- "Mark A. Sam" wrote in message: ... That's what I wanted. Thanks Jeff. |
#9
|
|||
|
|||
Date Picker
Excellent, glad to help!
-- Jeff Conrad - Access Junkie - MVP Alumni SDET - XAS Services - Microsoft Corporation Co-author - Microsoft Office Access 2007 Inside Out Presenter - Microsoft Access 2007 Essentials http://www.accessmvp.com/JConrad/accessjunkie.html Access 2007 Info: http://www.AccessJunkie.com ---------- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.mspx ---------- "Mark A. Sam" wrote in message: ... Jeff, I implemted this and on the first trial of the app, the user remarked that she liked it. Thanks again. |
Thread Tools | |
Display Modes | |
|
|