473,569 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ 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 1414
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
1647
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 doing a project of data mining, and I run a mysql database to store my data. the database structure:
0
5856
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 MyTable As Recordset Dim NextCounter As Long
18
6610
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 the loop. -- ----------------------------------- Ken Varn Senior Software Engineer Diebold Inc.
0
1289
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 formula: Interest = (Beginning Balance + Annual Investment) * Rate Assume the Investment Rate is entered and displayed as an annual rate. This formula...
9
3929
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 - I have read every post out there and spent hours trying to figure out the problem with no success whatsoever - I have constrained the problem to...
2
2829
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 currently set to auto fill and looks like this 00/00/0000-000. I want the last three digits to reset with the new year date field. Both fields are hidden...
3
1964
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. Thanks
1
2596
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 . There is then a table which records absences for each employee, it records the date of the absence etc and also holds the number of days absent . Each...
1
3797
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 varchar(16),name varchar(255),InDate datetime table C
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3662
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.