467,081 Members | 958 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,081 developers. It's quick & easy.

Auto count in a text field

I need an auto counting text field on a form. I need it to count from 0001 to unlimited in a years time for the number of records created, then start over at 0001 when the years time has elapsed. Please help.
Oct 9 '08 #1
  • viewed: 3135
1 Reply
Expert 8TB
Let's assume your AutoCount (TEXT) Field is named [AutoCount] and it is in a Table named tblTest.
  1. Manually enter the first entry, say 0078.
  2. Place the following Expression in the Control Source Property of a Text Box on your Form Bound to the [AutoCount] Field.
    Expand|Select|Wrap|Line Numbers
    1. =Format$(Val(DMax("[AutoCount]","tblTest"))+1,"0000")
  3. Now, each new Number will automatically be generated in your requested Format, and these Numbers will be sequential with no gaps, as in:
    Expand|Select|Wrap|Line Numbers
    1. 0079, 0080, 0081, 0082, 0083, ...
Oct 12 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Jim | last post: by
14 posts views Thread by zufie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.