473,836 Members | 1,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calendar not working

54 New Member
I several fields on a table set to date. On the form where users enter in the dates there automatically is a little calendar that shows up for them to select a date. This is nice because when entering many dates they can just click on the calendar instead of typing all of the dates. It only works the first time though. They enter information with these calendars and then click a submit button that takes them to a new record. This time when they click a date on the calendar it doesn't put the date into the box. They can still manually enter the date in though. Any ideas why this would be? Thanks.
Sep 6 '12 #1
16 9073
2,322 Recognized Expert Moderator Top Contributor
What access version? Is it 2010 and built in calender control(Date picker), or is it a custom calender control?

Is the form in datasheet, single record view, or continuous or split? Is the form bound?
Sep 6 '12 #2
54 New Member
Access version 2007. I guess it is the built in calender. It is just the one that appears at the side of a text box that is bound to a field on a table that accepts dates only. The form is just in the standard form view. The form is bound to the table with these fields that require dates.
Sep 6 '12 #3
2,322 Recognized Expert Moderator Top Contributor
This sounds weird to me. Do you have any VBA code or macros running in the form? If so, please post it all here, for review.

So your saying that after the first record is added people can still click the date picker, and select a date, but the date does not get written into the control?
Sep 7 '12 #4
54 New Member
This is all of the code for this form. The text boxes that are having this issue are "Date_Order ed" and "Delivery." Again it works the first time but not after that.
Expand|Select|Wrap|Line Numbers
  1. Private Sub BY_AfterUpdate()
  2. Me.Price_Unit.SetFocus
  3. End Sub
  5. Private Sub BY_GotFocus()
  6. If IsNull(Me.Date) = True Then
  7. Me.BY.Locked = True
  8. Else: Me.BY.Locked = False
  9. End If
  10. End Sub
  12. Private Sub Delete_Click()
  13. If IsNull(Me.finditem) = False Then
  14. Dim Msg, Style, Title, Response, MyString
  16. Msg = "Are you sure you want to delete this order?" & vbNewLine & "You cannot undo this action."
  17. Style = vbYesNo
  18. Title = "Warning!"
  20. Response = MsgBox(Msg, Style, Title, Help, Ctxt)
  22. If Response = vbNo Then
  23. Exit Sub
  24. End If
  25. If Response = vbYes Then
  26. DoCmd.Hourglass True
  27. DoCmd.SetWarnings False
  28. RunCommand acCmdDeleteRecord
  29. DoCmd.SetWarnings True
  31. Dim iCfg As Object
  32. Dim iMsg As Object
  33. Set iCfg = CreateObject("CDO.Configuration")
  34. Set iMsg = CreateObject("CDO.Message")
  35. With iCfg.Fields
  36. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "exc2007.futuraind.com"
  37. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  38. .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  39. .Update
  40. End With
  42. 'Stop
  43. With iMsg
  44. .Configuration = iCfg
  45. .Subject = "Order Canceled"
  46. .to = Me.purchasesub!Notify
  47. .TextBody = "The order for " & Me.finditem & " submitted on " & Me.Date & " has been cancled by purchasing.  Please address any issues or concerns with purchasing."
  48. '.AddAttachment "FullPathToAttachment"
  49. .from = "Purchasing"
  50. .sender = "PurchasingNoReply@futuraind.com"
  51. .send
  52. End With
  53. Set iMsg = Nothing
  54. Set iCfg = Nothing
  55. Call MsgBox("Your order was processed successfully!", vbOKOnly, "Success!")
  56. DoCmd.Close acForm, "purchase chemicals"
  57. DoCmd.OpenForm "purchase chemicals"
  58. DoCmd.Hourglass False
  59. DoCmd.Close acForm, "purchase chemicals"
  60. DoCmd.OpenForm "purchase chemicals"
  61. End If
  62. ElseIf IsNull(Me.finditem) = True Then
  63. Call MsgBox("There is not an order to delete.")
  64. Exit Sub
  65. End If
  66. End Sub
  68. Private Sub Complete_Click()
  69. If IsNull(Me.Date_Ordered) = True Then
  70. Call MsgBox("The Date Ordered is a required field.")
  71. Exit Sub
  72. ElseIf IsNull(Me.Date_Ordered) = False Then
  73. DoCmd.Hourglass True
  74. Dim iCfg As Object
  75. Dim iMsg As Object
  76. Set iCfg = CreateObject("CDO.Configuration")
  77. Set iMsg = CreateObject("CDO.Message")
  78. With iCfg.Fields
  79. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "exc2007.futuraind.com"
  80. .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
  81. .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
  82. .Update
  83. End With
  85. 'Stop
  86. With iMsg
  87. .Configuration = iCfg
  88. .Subject = "Order Completed On: " & DateValue(Now) & " at: " & TimeValue(Now)
  89. .to = Me.purchasesub!Notify
  90. .TextBody = "Date Requested: " & Me.Date & vbNewLine & "Item: " & Me.finditem & vbNewLine & "Units: " & Me.purchasesub!Units & vbNewLine & "Order Quantity: " & Me.purchasesub![Reorder Quantity] & vbNewLine & "Date Ordered: " & Me.Date_Ordered & vbNewLine & "Estimated Delivery Date: " & Me.Delivery & vbNewLine & "Purchase Order #: " & Me.PO & vbNewLine & "Purchased By: " & Me.BY & vbNewLine & "Price/Unit: " & Me.Price_Unit & vbNewLine & "Purchasing Comments: " & Me.Order_Comments
  91. '.AddAttachment "FullPathToAttachment"
  92. .from = "Purchasing"
  93. .sender = "PurchasingNoReply@futuraind.com"
  94. .send
  95. End With
  96. Set iMsg = Nothing
  97. Set iCfg = Nothing
  98. DoCmd.Close acForm, "purchase chemicals"
  99. DoCmd.OpenForm "purchase chemicals"
  100. DoCmd.Hourglass False
  101. End If
  102. End Sub
  104. Private Sub Date_Ordered_AfterUpdate()
  105. Me.Delivery.SetFocus
  106. End Sub
  108. Private Sub Date_Ordered_GotFocus()
  109. If IsNull(Me.Date) = True Then
  110. Me.Date_Ordered.Locked = True
  111. Else: Me.Date_Ordered.Locked = False
  112. End If
  113. End Sub
  115. Private Sub Delivery_AfterUpdate()
  116. Me.PO.SetFocus
  117. End Sub
  119. Private Sub Delivery_GotFocus()
  120. If IsNull(Me.Date) = True Then
  121. Me.Delivery.Locked = True
  122. Else: Me.Delivery.Locked = False
  123. End If
  124. End Sub
  126. Private Sub edit_Click()
  127. DoCmd.OpenTable "ordering information"
  128. End Sub
  130. Private Sub exit_Click()
  131. DoCmd.Close acForm, "purchase chemicals"
  132. DoCmd.OpenForm "order chemicals"
  133. End Sub
  135. Private Sub finditem_GotFocus()
  136. Dim strFilter As String, strOldFilter As String
  137.     strOldFilter = Me.Filter
  138.     If Me!finditem > "" Then _
  139.         strFilter = strFilter & _
  140.                     " AND ([chemical] Like '" & _
  141.                     Me!finditem & "*')"
  142.     If strFilter > "" Then strFilter = Mid(strFilter, 6)
  143.     If strFilter <> strOldFilter Then
  144.         Me.Filter = strFilter
  145.         Me.FilterOn = (strFilter > "")
  146.     End If
  147. End Sub
  149. Private Sub Form_Load()
  150. Dim strFEMaster As String
  151. Dim strFE As String
  152. Dim strMasterLocation As String
  153. Dim strFilePath As String
  155. ' looks up the version of the front-end as listed in the backend
  156. strFEMaster = DLookup("fe_version_number", "tbl-version_fe_master")
  158. ' looks up the version of the front-end on the front-end
  159. strFE = DLookup("fe_version_number", "tbl-fe_version")
  161. ' looks up the location of the front-end master file
  162. strMasterLocation = DLookup("s_masterlocation", "tbl-version_master_location")
  164. ' checks for the existence of an updating batch file and deletes it if it exists
  165.     strFilePath = CurrentProject.Path & "\UpdateDbFE.cmd"
  167.     If Dir(strFilePath) <> "" Then
  168.         Dim fs As Object
  169.         Set fs = CreateObject("Scripting.FileSystemObject")
  170.         fs.DeleteFile (strFilePath)
  171.         Set fs = Nothing
  172.     End If
  175. ' if the current database opened is the master then it bypasses the check.
  176. If CurrentProject.Path = strMasterLocation Then
  178.     Exit Sub
  180. Else
  182. ' if the version numbers do not match and it is not the master that is opened,
  183. ' the database will do the update process
  184.     If strFE <> strFEMaster Then
  185.         MsgBox "Your program is not the latest version." & vbCrLf & _
  186.         "The front-end needs to be updated.  The program will " & vbCrLf & _
  187.         "now close and then should reopen automatically.", vbCritical, "VERSION NEEDS UPDATING"
  189.         ' sets the global variable for the path/name of the current database
  190.         g_strFilePath = CurrentProject.Path & "\" & CurrentProject.Name
  192.         ' sets the global variable for the path/name of the database to copy
  193.         g_strCopyLocation = strMasterLocation
  195.         ' calls the UpdateFrontEnd module
  197.         UpdateFrontEnd
  199.     End If
  201. End If
  203. End Sub
  205. Private Sub Form_Open(Cancel As Integer)
  206. DoCmd.Maximize
  207. RunCommand acCmdRecordsGoToNew
  208. End Sub
  210. Private Sub Order_Comments_AfterUpdate()
  211. Me.Date_Ordered.SetFocus
  212. End Sub
  214. Private Sub Order_Comments_GotFocus()
  215. If IsNull(Me.Date) = True Then
  216. Me.Order_Comments.Locked = True
  217. Else: Me.Order_Comments.Locked = False
  218. End If
  219. End Sub
  221. Private Sub PO_AfterUpdate()
  222. Me.BY.SetFocus
  223. End Sub
  225. Private Sub PO_GotFocus()
  226. If IsNull(Me.Date) = True Then
  227. Me.PO.Locked = True
  228. Else: Me.PO.Locked = False
  229. End If
  230. End Sub
  232. Private Sub Price_Unit_AfterUpdate()
  233. Me.Order_Comments.SetFocus
  234. End Sub
  236. Private Sub Price_Unit_GotFocus()
  237. If IsNull(Me.Date) = True Then
  238. Me.Price_Unit.Locked = True
  239. Else: Me.Price_Unit.Locked = False
  240. End If
  241. End Sub
  243. Private Sub refresh_Click()
  244. DoCmd.Close acForm, "purchase chemicals"
  245. DoCmd.OpenForm "purchase chemicals"
  246. DoCmd.SetWarnings False
  247. DoCmd.OpenQuery "delete"
  248. DoCmd.SetWarnings True
  249. End Sub
Sep 7 '12 #5
5,501 Recognized Expert Moderator Expert
I have not been able to recreate the issue with any of my test databases using v2010.

I'm guessing that you're using: http://msdn.microsoft.com/en-us/libr.../gg251104.aspx - is that correct?

Just double check the properties are set as indicated.

The other thing... temporarily comment out your afterupdate events for both of these controls as they seem to be just form movement and see what happens (I'm just poking at things here to see what screams in the dark). Ideally, you should have the tab-order for your form set to move from one control to the next for most things and use the set-focus only when needed for an unusual situation or to get information from the control (weird.. ms... what can I say?!)

Sep 7 '12 #6
12,516 Recognized Expert Moderator MVP
What is Me.Date? And why are a bunch of the controls getting locked if it's null?
Sep 7 '12 #7
54 New Member
Z-Yes I am just using the built in date-picker. Settings are correct. I haven't changed anything with them. All I have done is made the field on the table require dates and the date-picker comes automatically. Yes my afterupdate events are just to move from one text box to another, like the tab controls. I am a newbie so I don't usually end up doing things in the most orthodox way I guess.

Rabbit-me.date is a box that contains that date that an order was submitted. The controls being locked is just my way of making sure that they do not enter information until they have actually selected an order to view.
Sep 7 '12 #8
5,501 Recognized Expert Moderator Expert
Another stab in the dark....

Change the locks to enabled=true/false... maybe the controls are still locked after the first go around?

Sep 7 '12 #9
54 New Member
They are not because I can type in the box. The calendar still shows up, but when I pick a date it does not go into the box.
Sep 7 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Treetop | last post by:
I am creating a calendar with JavaScript. I want to be able to put date and time in an array and have a calendar display properly with 7 columns. I am stuck at this point. Any help would be appreciated. I hope I formatted it properly for this group. var month="October 2003"; var ct = 0;
by: bingomanatee | last post by:
Does anyone have an event manager using PHP that works under PHP 5? Thanks in advance, Dave
by: Shuffs | last post by:
Could someone, anyone please tell me what I need to amend, to get this function to take Sunday as the first day of the week? I amended the Weekday parts to vbSunday (in my code, not the code attached), yet when I ran it for 28/09/2003 (UK date format) it returned Week 39. I would have expected it to return Week 40. However, I'm really stuck and my head is busting over this, so any pointers would be gratefully appreciated. Many thanks...
by: BlackFireNova | last post by:
I need to write a report in which one part shows a count of how many total records fall within the working days (Monday - Friday) inside of a (prompted) given date range, in a particular geographical region. I have written a query which prompts the user for the start and end dates. It also filters for entries which pertain to the particular geographical region. I'm not sure where to go from here.
by: Stinky Pete | last post by:
I've got a form that has been quite happily useing a pop up calendar to enter dates. However I've had to amend the world and add the form as a subform. To my frustration, the pop up calendar now does not work on the subform. Each time I click on the field, instead of allowing the date to pop into the field, I just get an error message asking me if I really want to close the calendar pup up. Suggestions ?? Stinky Pete
by: R.A.M. | last post by:
Hello, I need to implement popup calendar in ASP.NET application. I created a button opening popup calendar on 'master' page: <asp:Button ID="Calendar" runat="server" Text=Calendar" OnClientClick= "window.open('Calendar.aspx', 'Calendar', 'menubar=no, location=no, personalbar=no, status=no, resizable=no, scrollbars=no, width=200, height=200');" />
by: paulmac106 | last post by:
Hi. I utilize the Calendar table, and I'm able to find how many working days between 2 dates, but does anyone use this table to find the 2nd or 5th working date? if 11/30/06 then 12/4/06 I'm sure it's not too difficult but i can't seem to get it to work
by: larry | last post by:
I am in the process of rewriting one of my first PHP scripts, an event calendar, and wanted to share the code that is the core of the new calendar. My current/previous calendar processed data dates only, this code is intended to use more thrifty event descriptions (3rd saturday, last tuesday, etc.) as well as traditional one-of dates. The core here here is quite spartan, no table logic or or db cruft included (I figure you have our own...
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
by: sbettadpur | last post by:
hello everybody, i am using readymade popup calendar for my application, it's working fine. But i am facing some problem i.e. if i click on the calendar image it will open a calendar. below that i put one drop down select box, so layer of calendar is invisible due to this select box. where as instead of select box, if there is text box calendar is visible. how can i solve this problem. And also i used z-index property to push the...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.