1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Autofill in Access

Discussion in 'Business Applications' started by nightarrow85, Nov 28, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. nightarrow85

    nightarrow85 Thread Starter

    Joined:
    Nov 28, 2011
    Messages:
    3
    Hello,

    I need to update a shipping memo form to contain a field for Memo No. This field needs to be YY-000 where 000 is an entered number and YY is the current year (12 as of january). The field is already setup to take in user input, but is set with a static number as YY. How can I change the static number to auto-update with the year?

    Im brand new to Access.

    Thanks!
    nightarrow85
     
  2. spatha

    spatha

    Joined:
    Jun 20, 2011
    Messages:
    82
    Use this in place of the static number.

    Format(Date(), "yy")
     
  3. nightarrow85

    nightarrow85 Thread Starter

    Joined:
    Nov 28, 2011
    Messages:
    3
    I tried entering (date(), "yy")-000 into the format box, however the field is displaying ############.... and Access changes where the quotation marks are within the format box.

    What am I missing? :confused:
     
  4. spatha

    spatha

    Joined:
    Jun 20, 2011
    Messages:
    82
    The expression I gave you doesnt go in the Format property of the text box. I guess I assumed you were inputing the static number during the On Load event or something. Is it part of the Input Mask?
     
  5. nightarrow85

    nightarrow85 Thread Starter

    Joined:
    Nov 28, 2011
    Messages:
    3
    What I am specifically trying to do is click on the field I'm trying to change, then go to Property sheet. In the format box I currently have "11-"000 . The 11- part needs to be an autofill for the year so that this form doesnt need to be updated every year.

    I've tried "yy-"000 but the year comes out to be 1900-001 for the first form, followed by 1900-002 etc.

    I don't know how to make it to use 2011 (current year) so that the form numbers become 11-582 for this year, and then change to 12-001 once we hit January 1st.

    Thanks for your patience!
     
  6. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    Here is a simple way to do it with the after update event. Enter some number in text2 and hit tab.
     

    Attached Files:

  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1028816

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice