472,106 Members | 1,296 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,106 software developers and data experts.

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
1 3606
ADezii
8,830 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 Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.