Connecting Tech Pros Worldwide Help | Site Map

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

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 02:04 PM
marko
Guest
 
Posts: n/a
Default 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


  #2  
Old November 13th, 2005, 02:04 PM
King Ron
Guest
 
Posts: n/a
Default Re: How can i make a fiels reset on every date change,and auto increasing?

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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.