Results 1 to 8 of 8
  1. #1
    Bruce is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    72

    Default Value CurrentMonth


    I have an unbound textbox in a form that I want to autopopulate with the current month (text). I've tried setting the default value to Date(M), Now(M), =Format(Month) etc. Any suggestions? Thanks.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Look up MonthName in VBA help.

  3. #3
    Bruce is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    72
    I tried to put =
    =MonthName(month[, abbreviate]) in the "Default Value" field but it still
    displays #Error. I can put in =Date(), =Time(), =Now() and all of these work. Do I have to create an "Event" Code procedure...like..On Dirty...?
    If so, how would that read? I'm just learning VBA.

    Thanks!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    This is an unbound control right? Just make it the ControlSource:
    =MonthName(Month(Date()))

  5. #5
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Try this as the Control Source

    =Month(Date())

  6. #6
    Bruce is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2009
    Posts
    72
    Figured it out. In the "Default Value" field =Format(Date(),"mmmm")Access 2003 didn't know the common expression Month.

  7. #7
    Rainlover's Avatar
    Rainlover is offline Expert
    Windows XP Access 2003
    Join Date
    Nov 2009
    Location
    Queensland Australia
    Posts
    691
    Not sure your comment is correct.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So I would guess you are ready to follow the link in my sig and mark this thread as Solved.

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

Similar Threads

  1. Default window
    By Tareq_1993 in forum Access
    Replies: 2
    Last Post: 11-26-2009, 09:37 AM
  2. Table opening by default
    By rod147 in forum Access
    Replies: 1
    Last Post: 07-07-2009, 10:01 AM
  3. update default value in form
    By leah7au in forum Access
    Replies: 3
    Last Post: 05-14-2009, 07:11 AM
  4. Default Value Question
    By ulia in forum Database Design
    Replies: 2
    Last Post: 11-22-2006, 02:37 PM
  5. Default Values
    By twainscott in forum Programming
    Replies: 0
    Last Post: 09-14-2006, 11:18 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