Creating a Counter

  • Thread starter ldrucker via AccessMonster.com
  • Start date
L

ldrucker via AccessMonster.com

I am new with visual basic and access. I have created an access db and now
need to create an autogenerated system number YYYY-XX-9999 where YYYY is the
current year, XX a group code and 9999 a is a four positions incrementing
counter.

From an Action Form I would like to click add new record and it execute VB
code to do the following:

1. From the system date determine the current year, If this is a new year
then reset the field Current_Counter (in the Counter table) to zero.

2. Look at the field Current_Counter, get the current value, increment it by
one and then save the value in Current_Counter field.

3. Create a string value YYYY-XX-9999 and store in a System_Tracking_No field
on the Action Form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top