Results 1 to 3 of 3
  1. #1
    lugnutmonkey is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2013
    Posts
    42

    how to populate a combo box with data from Date/Time Field

    How can I populate a combo box with the years present in a Date/Time field?



    I would like to setup a combo box that will only contain the years available in a Date/Time field. So that the user can't select a record from a year that has been moved to an archive table.

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You can use a query and base the combo box on the query

    SELECT DISTINCT Year(yourdatetimefield)
    FROM yourtablename

  3. #3
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    After opening this link, scroll down to the section on combo boxes. Three tutorials there.

    http://www.datapigtechnologies.com/AccessMain.htm

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

Similar Threads

  1. Replies: 2
    Last Post: 06-20-2012, 09:49 PM
  2. Replies: 6
    Last Post: 04-27-2012, 01:31 PM
  3. Replies: 1
    Last Post: 08-07-2011, 07:58 AM
  4. auto populate combo field?
    By myboii in forum Access
    Replies: 8
    Last Post: 07-09-2010, 05:46 AM
  5. Use a combo box to populate a text field
    By niesenj in forum Forms
    Replies: 2
    Last Post: 01-29-2010, 01:57 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