Results 1 to 10 of 10
  1. #1
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231

    Calendar Button to Select Dates


    I was reviewing another order database and the form had a calendar button beside a date field to select the date.

    Where does one find this button and how is it entered into the form?

    Please see attached image.

    CementCarver
    Attached Thumbnails Attached Thumbnails calendar button.JPG  

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596

  3. #3
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Robeen, thanks for the link and explanation.....CementCarver

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I have not used the Calendar Control in Access 2010 - so please let us know if the instructions work for you.
    Thanks & All the Best!!

  5. #5
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Will Do...CC

  6. #6
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Don't have the current .ocx. Will investigate download material and get back to you.

    CC

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Versions 2007 and later have a DatePicker that, by default, will automatically appear when a Field defined as Date/Time is entered.

    You can actually have the calendar 'pop up' when the Control has Focus, rather than requiring that the user click on the icon to pop the calendar up, with code like
    Code:
    Private Sub DateField_GotFocus()
      DoCmd.RunCommand acCmdShowDatePicker
    End Sub

    To have it only pop up, on Focus, if the Textbox is empty:
    Code:
    Private Sub DateField_GotFocus()
     If Nz(Me.DateField,"") = "" Then
      DoCmd.RunCommand acCmdShowDatePicker
     End If
    End Sub

    And while it doesn't have a Property Pane, using the DatePicker is treated as if the data were physically entered, which means that you can attach actions to the usual Events of the Control, such as its BeforeUpdate and AfterUpdate events.

    You could, for example, insure that any date entered is not in the past, and if this rule is violated, pop a warning message to the user, Cancel the Field update, and pop up the DatePicker once again, ready for a correct date to be entered:
    Code:
    Private Sub DateField_BeforeUpdate(Cancel As Integer)
     If Me.DateField < Date Then
      MsgBox "Invalid Date!"
      Cancel = True
      DoCmd.RunCommand acCmdShowDatePicker
     End If
    End Sub

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Thanks Missinglinq. Will investigate.

    Cc

  9. #9
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    For what it's worth ---- I have used an unbound textbox, and set the default to General Date and a DatePicker will be placed next to the textbox on the form.

  10. #10
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Thx Orange.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-24-2013, 09:30 PM
  2. Custom calendar - select multiple dates
    By larek in forum Access
    Replies: 6
    Last Post: 06-23-2011, 02:40 AM
  3. Calendar to and From Dates
    By bobfin in forum Reports
    Replies: 10
    Last Post: 08-05-2010, 07:05 PM
  4. Replies: 2
    Last Post: 04-23-2010, 01:31 AM
  5. Select last 2 dates of service
    By kfinpgh in forum Queries
    Replies: 1
    Last Post: 11-25-2009, 07:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums