473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How can i make a fiels reset on every date change,and auto increasing?

Here is my problem.
How can i make a field in a form change to a value 1 every morning when
I turn access on, when the date changes?
And how can i make a button on a form which would open another form and
increase the value of one field by 1. The first value of that field
would be 1(from the morning and increasing through the day) and it
would fill in automatically from the last record and then i would push
that button. It would increase that value by one, open another form and
go to the next record.
Please help!
Thanks,

Marko Svaco

Nov 13 '05 #1
1 2354
for Question1: date stamp each row as it's created with the current
date, then create a vb function that counts the number of records
previously entered with the 'Current' date + 1 and set your counter
field to that value.

Each time you enter a new row, call this routine.

<uncompiled code>

MyForm.CreateDate = Date()
MyForm.MyCounterField = GetDayCount(Date())
Me.Refresh

Public Function GetDayCount(InDate as Date) as Long
GetDateCount = DCount("MyTable","[CreateDate] = #" & InDate & "#") +
1
End Function

</uncompiled code>

King Ron of Chi

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
0
by: marko | last post by:
Here is my problem. How can i make a field in a form change to a value 1 every morning when I turn access on, when the date changes? And how can i make a button on a form which would open another...
5
by: Nathan Sokalski | last post by:
I have a user control that contains three variables which are accessed through public properties. They are declared immediately below the "Web Form Designer Generated Code" section. Every time an...
3
by: atomD21 | last post by:
I am working on creating a form for potential clients to email me their name, email address and a comment about how I can be of service to them. I have the form basically completed, but I am running...
11
by: newbie | last post by:
i have a form in which a hidden field (initial value as '0', and my javascript set it to '1' when an event is trigged). In the same form, i have a reset field. But I realized that the hidden field...
8
by: Wayne L | last post by:
I have searched and could not find my solution to my problem. I have a table that has a field that I want to start at 0001 and go to 1999. Once it reaches 1999 I want the field to reset to 0001. I...
5
by: barmatt80 | last post by:
I have a field(RecordID) in my database that is in this format: 2008-0001-MED The first 4 digits is the year in 4 digits, the second 4 numbers are an autonumber or a incremential number increasing...
2
anoble1
by: anoble1 | last post by:
Hey I am wanting to reset a date range to lets say 1/1/2008 - 12/31/2008. So when I click on reset i want it to bring those values up and limit everything by them. That way it brings up every...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.