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 |
#11
|
|||
|
|||
Popup Calendar
Thanks again for your help; however, I still cannot get the focus set. There
must be something in the other code on this subform blocking the action. I did get Arvin Meyer's calendar to work on the subform. Would you like me to send all the subform code so you might solve this enigma? It is not too extensive. Thanks "'69 Camaro" wrote: Hi, Shep. If both the date text box and the calendar control are on the subform, then your code should work, unless you wrote code elsewhere -- or changed the calendar control's property -- that interferes with this. Did you disable the calendar control? Check the DateCalendar's "Data" tab in the Properties dialog window. The Enabled Property should be set to Yes. If it is, then search through the code for the following: DateCalendar.Enabled = False The DateCalendar must be enabled when the focus is set to it. If you can't find where it's been disabled, then in your subform's module try: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.Enabled = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. (Please remove ZERO_SPAM from my reply E-mail address so that a message will be forwarded to me.) - - - If my answer has helped you, please sign in and answer yes to the question "Did this post answer your question?" at the bottom of the message, which adds your question and the answers to the database of answers. Remember that questions answered the quickest are often from those who have a history of rewarding the contributors who have taken the time to answer questions correctly. "shep" wrote: Thanks for your response The date field and calerndar control are on the subform. Your explanation about the subform's status when the form is open may be why it is not setting focus of the calendar control. It may be that the setfocus function is controlled by the form. Hopefully there is a way to code it so the calendar will work on the subform. Thanks again for your help. "'69 Camaro" wrote: Hi, Shep. If the TransactionDate text box resides on the main form and the DateCalendar calendar control resides on the subform, then find out the name of the subform control. This is _not_ the name of the subform, unless you've made the mistake of naming them the same. Whenever the main form is open, the subform _doesn't_ exist. It's being "held" by a special control on the form, the subform control, which must be referenced as a control before any of the controls residing on it can be referenced. Therefore, if the TransactionDate text box resides on the main form and the DateCalendar calendar control resides on the subform, then try: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Me!MyCtrl.Form.DateCalendar.Visible = True Me!MyCtrl.Form.DateCalendar.SetFocus If Not IsNull(Me!TransactionDate.Value) Then Me!MyCtrl.Form.DateCalendar.Value = Me!TransactionDate.Value Else Me!MyCtrl.Form.DateCalendar.Value = Date End If End Sub . . . where MyCtrl is the name of the subform control. HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. (Please remove ZERO_SPAM from my reply E-mail address so that a message will be forwarded to me.) - - - If my answer has helped you, please sign in and answer yes to the question "Did this post answer your question?" at the bottom of the message, which adds your question and the answers to the database of answers. Remember that questions answered the quickest are often from those who have a history of rewarding the contributors who have taken the time to answer questions correctly. "shep" wrote: Using MS Office 2003 Pro I am trying to add a popup calendar to a subform to enable users to select date vice typing it in a date field. I have done this on several forms, but cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't move the focus to the control DateCalendar " Here is code that works on forms: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub Is there a way to get this to work on the subform? Thanks |
#12
|
|||
|
|||
Popup Calendar
Thank you, your calendar works on the subform. When I move the pointer over
the calendar it changes to a vertical bar. Is that normal or maybe something in my mouse setting? Regardless, it works great. Many thanks "Arvin Meyer [MVP]" wrote: Use my calendar at: http://www.datastrat.com/Download/Calendar2K.zip Simply import the calendar for and the module into your database, and use the double-click event in any date field to place the following expression : =popCalendar() Works in forms, subforms and can be converted to every version of Access. -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads http://www.datastrat.com http://www.mvps.org/access "shep" wrote in message ... Did you get a popup calendar to work on a subform? If so, will you share the code with me? Thanks "Darhl Thomason" wrote: Don't reinvent the wheel...I just asked this exact question three days ago and got some great ideas, the best of which I felt could be found at and downloaded for free from http://allenbrowne.com/ser-51.html Allen's got a great Access site that is now in my favorites list. Good luck! "shep" wrote in message news Using MS Office 2003 Pro I am trying to add a popup calendar to a subform to enable users to select date vice typing it in a date field. I have done this on several forms, but cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't move the focus to the control DateCalendar " Here is code that works on forms: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub Is there a way to get this to work on the subform? Thanks |
#13
|
|||
|
|||
Popup Calendar
Hi, Shep.
Would you like me to send all the subform code so you might solve this enigma? Feel free to post the code, but seeing as you've already found a better alternative, you probably shouldn't be losing sleep over this one. You've got plenty of other fish to fry, so you should spend your time on those. Good luck. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. "shep" wrote in message ... Thanks again for your help; however, I still cannot get the focus set. There must be something in the other code on this subform blocking the action. I did get Arvin Meyer's calendar to work on the subform. Would you like me to send all the subform code so you might solve this enigma? It is not too extensive. Thanks "'69 Camaro" wrote: Hi, Shep. If both the date text box and the calendar control are on the subform, then your code should work, unless you wrote code elsewhere -- or changed the calendar control's property -- that interferes with this. Did you disable the calendar control? Check the DateCalendar's "Data" tab in the Properties dialog window. The Enabled Property should be set to Yes. If it is, then search through the code for the following: DateCalendar.Enabled = False The DateCalendar must be enabled when the focus is set to it. If you can't find where it's been disabled, then in your subform's module try: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.Enabled = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. (Please remove ZERO_SPAM from my reply E-mail address so that a message will be forwarded to me.) - - - If my answer has helped you, please sign in and answer yes to the question "Did this post answer your question?" at the bottom of the message, which adds your question and the answers to the database of answers. Remember that questions answered the quickest are often from those who have a history of rewarding the contributors who have taken the time to answer questions correctly. "shep" wrote: Thanks for your response The date field and calerndar control are on the subform. Your explanation about the subform's status when the form is open may be why it is not setting focus of the calendar control. It may be that the setfocus function is controlled by the form. Hopefully there is a way to code it so the calendar will work on the subform. Thanks again for your help. "'69 Camaro" wrote: Hi, Shep. If the TransactionDate text box resides on the main form and the DateCalendar calendar control resides on the subform, then find out the name of the subform control. This is _not_ the name of the subform, unless you've made the mistake of naming them the same. Whenever the main form is open, the subform _doesn't_ exist. It's being "held" by a special control on the form, the subform control, which must be referenced as a control before any of the controls residing on it can be referenced. Therefore, if the TransactionDate text box resides on the main form and the DateCalendar calendar control resides on the subform, then try: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Me!MyCtrl.Form.DateCalendar.Visible = True Me!MyCtrl.Form.DateCalendar.SetFocus If Not IsNull(Me!TransactionDate.Value) Then Me!MyCtrl.Form.DateCalendar.Value = Me!TransactionDate.Value Else Me!MyCtrl.Form.DateCalendar.Value = Date End If End Sub . . . where MyCtrl is the name of the subform control. HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. (Please remove ZERO_SPAM from my reply E-mail address so that a message will be forwarded to me.) - - - If my answer has helped you, please sign in and answer yes to the question "Did this post answer your question?" at the bottom of the message, which adds your question and the answers to the database of answers. Remember that questions answered the quickest are often from those who have a history of rewarding the contributors who have taken the time to answer questions correctly. "shep" wrote: Using MS Office 2003 Pro I am trying to add a popup calendar to a subform to enable users to select date vice typing it in a date field. I have done this on several forms, but cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't move the focus to the control DateCalendar " Here is code that works on forms: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub Is there a way to get this to work on the subform? Thanks |
#14
|
|||
|
|||
Popup Calendar
"shep" wrote in message
... Thank you, your calendar works on the subform. When I move the pointer over the calendar it changes to a vertical bar. Is that normal or maybe something in my mouse setting? Regardless, it works great. Each of the dates is in a tiny text box, so yoy will get that cursor behavior. You could mess with the mouse over event and maybe change it. The code is wide open to use or change. -- Arvin Meyer, MCP, MVP Microsoft Access Free Access downloads http://www.datastrat.com http://www.mvps.org/access |
#15
|
|||
|
|||
Popup Calendar
I am posting the code in case you have time to explore. I just don't
understand why the MS Cal is not working in this subform. However, I agree that it is not critical since there are alternatives. Thanks again to you and others who have helped. Best Regards Code ( this is from the MS template Inventory Control, to which I added the calendar code). Option Explicit Option Compare Database Private Sub ViewPurchaseOrders() On Error GoTo Err_ViewPurchaseOrders If IsNull(Forms![Products]![ProductID]) Then MsgBox "Enter product information before entering purchase order." Else DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 DoCmd.OpenForm "Purchase Orders" If Me![PurchaseOrderID] 0 Then DoCmd.GoToControl "PurchaseOrderID" DoCmd.FindRecord Me![PurchaseOrderID] Else If Not IsNull(Forms![Purchase Orders]![PurchaseOrderID]) Then DoCmd.DoMenuItem acFormBar, 3, 0, , acMenuVer70 End If End If End If Exit_ViewPurchaseOrders: Exit Sub Err_ViewPurchaseOrders: MsgBox Err.Description Resume Exit_ViewPurchaseOrders End Sub Private Sub DateCalendar_Click() TransactionDate.Value = DateCalendar.Value TransactionDate.SetFocus DateCalendar.Visible = False End Sub Private Sub TransactionDate_DblClick(Cancel As Integer) ViewPurchaseOrders End Sub Private Sub PurchaseOrderID_DblClick(Cancel As Integer) ViewPurchaseOrders End Sub Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub Private Sub TransactionDescription_DblClick(Cancel As Integer) ViewPurchaseOrders End Sub Private Sub UnitsOrdered_DblClick(Cancel As Integer) ViewPurchaseOrders End Sub Private Sub UnitsReceived_DblClick(Cancel As Integer) ViewPurchaseOrders End Sub Private Sub UnitsSold_DblClick(Cancel As Integer) ViewPurchaseOrders End Sub Private Sub UnitsShrinkage_DblClick(Cancel As Integer) ViewPurchaseOrders End Sub "'69 Camaro" wrote: Hi, Shep. Would you like me to send all the subform code so you might solve this enigma? Feel free to post the code, but seeing as you've already found a better alternative, you probably shouldn't be losing sleep over this one. You've got plenty of other fish to fry, so you should spend your time on those. Good luck. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. "shep" wrote in message ... Thanks again for your help; however, I still cannot get the focus set. There must be something in the other code on this subform blocking the action. I did get Arvin Meyer's calendar to work on the subform. Would you like me to send all the subform code so you might solve this enigma? It is not too extensive. Thanks "'69 Camaro" wrote: Hi, Shep. If both the date text box and the calendar control are on the subform, then your code should work, unless you wrote code elsewhere -- or changed the calendar control's property -- that interferes with this. Did you disable the calendar control? Check the DateCalendar's "Data" tab in the Properties dialog window. The Enabled Property should be set to Yes. If it is, then search through the code for the following: DateCalendar.Enabled = False The DateCalendar must be enabled when the focus is set to it. If you can't find where it's been disabled, then in your subform's module try: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.Enabled = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. (Please remove ZERO_SPAM from my reply E-mail address so that a message will be forwarded to me.) - - - If my answer has helped you, please sign in and answer yes to the question "Did this post answer your question?" at the bottom of the message, which adds your question and the answers to the database of answers. Remember that questions answered the quickest are often from those who have a history of rewarding the contributors who have taken the time to answer questions correctly. "shep" wrote: Thanks for your response The date field and calerndar control are on the subform. Your explanation about the subform's status when the form is open may be why it is not setting focus of the calendar control. It may be that the setfocus function is controlled by the form. Hopefully there is a way to code it so the calendar will work on the subform. Thanks again for your help. "'69 Camaro" wrote: Hi, Shep. If the TransactionDate text box resides on the main form and the DateCalendar calendar control resides on the subform, then find out the name of the subform control. This is _not_ the name of the subform, unless you've made the mistake of naming them the same. Whenever the main form is open, the subform _doesn't_ exist. It's being "held" by a special control on the form, the subform control, which must be referenced as a control before any of the controls residing on it can be referenced. Therefore, if the TransactionDate text box resides on the main form and the DateCalendar calendar control resides on the subform, then try: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Me!MyCtrl.Form.DateCalendar.Visible = True Me!MyCtrl.Form.DateCalendar.SetFocus If Not IsNull(Me!TransactionDate.Value) Then Me!MyCtrl.Form.DateCalendar.Value = Me!TransactionDate.Value Else Me!MyCtrl.Form.DateCalendar.Value = Date End If End Sub . . . where MyCtrl is the name of the subform control. HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. (Please remove ZERO_SPAM from my reply E-mail address so that a message will be forwarded to me.) - - - If my answer has helped you, please sign in and answer yes to the question "Did this post answer your question?" at the bottom of the message, which adds your question and the answers to the database of answers. Remember that questions answered the quickest are often from those who have a history of rewarding the contributors who have taken the time to answer questions correctly. "shep" wrote: Using MS Office 2003 Pro I am trying to add a popup calendar to a subform to enable users to select date vice typing it in a date field. I have done this on several forms, but cannot get it to work on the subform. I get "error msg 2110 MS ACCESS can't move the focus to the control DateCalendar " Here is code that works on forms: Private Sub TransactionDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) DateCalendar.Visible = True DateCalendar.SetFocus If Not IsNull(TransactionDate) Then DateCalendar.Value = TransactionDate.Value Else DateCalendar.Value = Date End If End Sub Is there a way to get this to work on the subform? Thanks |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Clearing my Calendar | Chaplain Doug | Calendar | 0 | August 22nd, 2005 04:21 PM |
Calendars in OL2003/OL2000 | Rich | General Discussion | 16 | February 10th, 2005 12:41 AM |
Group calendar stranegly loses appointments a while after theire m | Tim de Jager | Calendar | 1 | July 21st, 2004 04:51 PM |
Sync Outlook 2002 SP2 Personal Calendar with Exchange Calendar | Larry | Calendar | 0 | May 29th, 2004 12:06 AM |
Calendar and Public Exchange Folder | Markus Broy | Calendar | 2 | May 29th, 2004 12:01 AM |