Results 1 to 4 of 4
  1. #1
    beefyalby is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    4

    default month and year

    I have a form that has a field with these dates:
    1-Nov-10
    1-Dec-10
    1-Jan-11



    I want the form to open up to the date 1-Dec-10 corresponding with the current month and year.

    In January, 2011 I want the form to automatically open up with 1-Jan-11 as the default value.

    How do I do this?

  2. #2
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Quote Originally Posted by beefyalby View Post
    I have a form that has a field with these dates:
    1-Nov-10
    1-Dec-10
    1-Jan-11

    I want the form to open up to the date 1-Dec-10 corresponding with the current month and year.

    In January, 2011 I want the form to automatically open up with 1-Jan-11 as the default value.

    How do I do this?
    Are you asking about two different things (filter a form and default value of a control)?


    It is possible to calculate the start date of the month from the computers current date.

    The first day current month: DateSerial(Year(Date()), Month(Date()), 1)

    You could use this to as criteria in the form's record source.

  3. #3
    beefyalby is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    4
    no, i simply would like the form to open up selecting the record that coincides with the current month and year.
    so yes, a default value based on the current month and year

  4. #4
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Quote Originally Posted by beefyalby View Post
    no, i simply would like the form to open up selecting the record that coincides with the current month and year.
    so yes, a default value based on the current month and year
    A default value is a property of a control or field in a table.

    I am thinking you really are not wanting to set the default property for an object.

    I think you want to control the form's record source.

    Here are some possible options:

    1) Limited to just record for the current month and later?
    2) Limited to just record for the current month?
    3) All records. Position the form's recordset to have the current record be the first record for the current month.

    The first two option can be Done in the query. Or could be done with the form's filter. The filter could later be removed.

    Option 3 will require some VBA code.

    Which option do you want or is it something else?

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

Similar Threads

  1. Replies: 5
    Last Post: 11-15-2010, 06:12 PM
  2. Year to date sum
    By jzacharias in forum Database Design
    Replies: 6
    Last Post: 09-10-2010, 10:38 AM
  3. fiscal year
    By RedGoneWILD in forum Programming
    Replies: 4
    Last Post: 08-04-2010, 01:38 PM
  4. by year by month
    By nkuebelbeck in forum Reports
    Replies: 21
    Last Post: 03-24-2010, 01:53 PM
  5. Current month in a field as default
    By leandrosarno in forum Access
    Replies: 6
    Last Post: 02-09-2010, 05:40 AM

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