Results 1 to 5 of 5
  1. #1
    edmscan is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168

    Question Dependent comboboxes and date picker

    Re: https://www.accessforums.net/forms/o...ges-41573.html I want a similar thing .. I have a listbox, and 2 dates (start date and end date) on the bottom of the form. When I select a start date from the datepicker (just easier than forcing a manual entry of the date) .. I want to reformat the start date textbox as yyyy/mm/dd and make the end date 6 days in the future from the start date. I could never find anything that would fire when I selected a date from the picker. I finally ended up using a button which I put my format code in .. and to change the end date and finally requery the listbox which uses those 2 dates. It works .. but I agree, there should be something that fires when the date is selected from the picker. These are all unbound controls. If anyone comes up with something I would be interested.
    Last edited by June7; 03-23-2014 at 11:29 PM.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Unlike many previous ActiveX DatePickers and Form-based calendars, Access does consider the Control to be physically populated when done thru this native DatePicker, meaning that all of the Control's associated events, such as the BeforeUpdate event, AfterUpdate event, etc, will fire.

    A Control's AfterUpdate event doesn't fire until you leave the Control, but you can put your code in this event, then use code to force the Focus elsewhere, which will make AfterUpdate fire:


    Move to another Control

    Code:
    Private Sub DateField_Change()
      AnotherControl.SetFocus
    End Sub


    You'll need to replace DateField and AnotherControl with names of your actual Controls.

    Linq ;0)>

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Using the intrinsic date picker to select a date and then format it as you wish will be problematic because the user will need to see the American date format (textbox control associated with the picker) in order for the date picker to work.

    Using a series of comboboxes, one for the year, one for the month, and one for the date; will probably be the best solution.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by ItsMe View Post

    Using the intrinsic date picker to select a date and then format it as you wish will be problematic because the user will need to see the American date format (textbox control associated with the picker) in order for the date picker to work.
    I don't follow; the user will only see a calendar! The Date Format doesn't really come into using the DatePicker.

    Linq ;0)>

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    OP wants to do the following....
    "... I want to reformat the start date textbox as yyyy/mm/dd and make the end date 6 days in..."

    So I am imagining the need for an expression somewhere. I am also imagining the control associated with the date picker being visible in order for the intrinsic date picker to be used. The fact that the control associated with the date picker is visible will cause confusion for the User.

    Now that I am posting this.... I suppose you could have an unbound textbox control on top of the date picker (to the side of the picker and on top of the control). But then back to the original issue of firing the expression after the date picker is clicked.

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

Similar Threads

  1. Show Date Picker on Load and Verifying Date
    By Markb384 in forum Forms
    Replies: 4
    Last Post: 03-04-2014, 07:44 AM
  2. Date criteria using between and form date picker
    By killermonkey in forum Queries
    Replies: 3
    Last Post: 03-21-2013, 12:44 PM
  3. Replies: 2
    Last Post: 05-16-2012, 03:10 PM
  4. Date Picker
    By kelly in forum Database Design
    Replies: 3
    Last Post: 09-15-2011, 12:42 PM
  5. Date Picker
    By otisdaddy in forum Database Design
    Replies: 2
    Last Post: 07-01-2011, 12:30 PM

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