473,471 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need to reset a count at the beginning of each year

1 New Member
Greatings,

I am a vbs newbie, about two months of class.

I am working on a dispatching program which uses an incrementing call number. The call number is made up of two separate parts, the last two digits of the year, (which I have worked out), and an integer, “CallCount” i.e. 07 0115. The two are displayed in a separate text boxes. Each time a call is added, (the “AddCall” button clicked), the CallCount is increased by one. I need to reset the four-digit count back to 1 at midnight on January 1st of each year. I am thinking a “Do Until” the date equals 31 December 11:59:59, or use the year string change as a trigger but I am unsure if this will actually work. Is there a simple solution?

Thanks in advance
Nov 8 '07 #1
1 1407
kadghar
1,295 Recognized Expert Top Contributor
Greatings,

I am a vbs newbie, about two months of class.

I am working on a dispatching program which uses an incrementing call number. ...
how are you actualizing the text boxes? what you can do is to put a simple if there, lets say TextBox1 is the one of the year and TextBox2 is the one of the integer, then something like this should do

Expand|Select|Wrap|Line Numbers
  1. if textbox1.text <> right(str(year(date)),2) then textbox2=0
  2. textbox1.text = right(str(year(date)),2)
  3. textbox2.text = textbox2.text+1
HTH
Nov 8 '07 #2

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

Similar topics

2
by: Alexandre MELARD | last post by:
Hi, My name is alexandre, I am 4th year student at the Napier university of edinburgh. I am finishing my year and do a presentation of my honours project next wednesday (the 5th of May). I am...
0
by: Earl Anderson | last post by:
KB Article Q140908 provided the following function to create an Auto Incrementing Counter: Function Next_Custom_Counter () On Error GoTo Next_Custom_Counter_Err Dim MyDB As Database Dim...
18
by: Ken Varn | last post by:
Is there any way to reset a foreach loop to re-iterate through the collection as if it were starting from the beginning? Namely, if I delete an item out of a collection, I want to be able to reset...
0
by: RaiderXCChamp | last post by:
Hi! I am supposed to create a program that will display an investment schedule in a list box for my Visual Basics Class. 1. It says that annual interest is calculated using the simple interest...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
2
by: DeanO | last post by:
I am trying to set my autonumber field to reset automatically at the beginning of each new year. This is a three digit field and is used with the date for a report number field. The number is...
3
by: DeanO | last post by:
I have a field (ID ) this field is an autonumer. I would like to automatically reset the autonumber at the beginning of every year. I know how to reset the field manually but not automatically. ...
1
by: muld | last post by:
I've inherited a database system designed to calculate sickness absence statistics. There is a main table with an employee ID which also holds the number of days worked by that person in a year ....
1
by: kummu4help | last post by:
hi, i am using mysql. i have 3 tables with following structures. these are not actual tables i am working on. table A id varchar(16),name varchar(255),InDate datetime table B id...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.