473,586 Members | 2,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2373
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.CreateDa te = Date()
MyForm.MyCounte rField = GetDayCount(Dat e())
Me.Refresh

Public Function GetDayCount(InD ate 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
5857
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
16
20468
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 can go without the system crashing. An ancillary question is how one resets an auto number so that the sequence starts again at 1. In the case...
0
334
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 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...
5
5947
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 event is fired by one of the controls contained in the User Control, these variable are reset. Here is my current code (I have a little more to add...
3
1834
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 into problems trying to change the size of the text field for the actual message. I know you can use size to change how long it is, but I want to...
11
7407
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 is not reset to '0' when i push the reset button. If I simply change the node from "<input type="hidden" id='IsChanged' value='0'>" to "<input...
8
12505
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 am importing unique records and the date and number separates the records but some days there may be more than one import. So if I set the field to...
5
5508
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 by 1 each time a new entry and the last 3 are a code based on the department of where the entry starts. I got it all to work, but I need the 0001...
2
2186
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 record. Right now it doesn't seem to work it clears out every record and the dates don't change. It changes the date but does not Requery the form. So no...
0
7839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8215
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5710
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
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
3836
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
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1179
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.