Date change at midnite - open form 
Author Message
 Date change at midnite - open form

I am having trouble with a module I wrote to return the current date, when
the date changes at midnite.  I am using the module in a form as a custom
counter. The counter returns the Julian day of year and a sequencial number.
When the date changes the counter is reset to 1.  The difficulty I am having
is that the form / module returns the date the form was opened and will not
update to the 'true/new day' current system date until the form is closed
and reopened.  I suppose that I could close the form and reopen it when the
user goes to a new record, but I would think there is a better way to get
the 'true' current system date when the date changes while a form is open.


Thu, 27 Dec 2001 03:00:00 GMT  
 Date change at midnite - open form
John
Set your timer interval and run the counter in the On Timer event.

hope this helps
James

Quote:

> I am having trouble with a module I wrote to return the current date, when
> the date changes at midnite.  I am using the module in a form as a custom
> counter. The counter returns the Julian day of year and a sequencial number.
> When the date changes the counter is reset to 1.  The difficulty I am having
> is that the form / module returns the date the form was opened and will not
> update to the 'true/new day' current system date until the form is closed
> and reopened.  I suppose that I could close the form and reopen it when the
> user goes to a new record, but I would think there is a better way to get
> the 'true' current system date when the date changes while a form is open.



Fri, 28 Dec 2001 03:00:00 GMT  
 Date change at midnite - open form
Set the datecontrol  to current date when the form is open. Set up the
form's timer to run periodically and get the system date and check if
system date is different from the date in your control.

Or if you just need the current date without any checks , set up your
timer event to update the control with system date say every 10
minutes.

Nirmala Sekhar
-----------------------------------------------------
Monthly newsletter on Microsoft Access at
http://www.saicomsystems.com/index.asp?id=tips
Fortnightly newsletter on motivational quotes
http://www.saicomsystems.com/index.asp?id=mind
******************************************************

On Sun, 11 Jul 1999 23:55:46 -0700, "John Hanak"

Quote:

>I am having trouble with a module I wrote to return the current date, when
>the date changes at midnite.  I am using the module in a form as a custom
>counter. The counter returns the Julian day of year and a sequencial number.
>When the date changes the counter is reset to 1.  The difficulty I am having
>is that the form / module returns the date the form was opened and will not
>update to the 'true/new day' current system date until the form is closed
>and reopened.  I suppose that I could close the form and reopen it when the
>user goes to a new record, but I would think there is a better way to get
>the 'true' current system date when the date changes while a form is open.



Fri, 28 Dec 2001 03:00:00 GMT  
 Date change at midnite - open form
Hi,

You could run code attached to the form's Timer event that occasionally
updates a module level variable that holds the current date.

Alternatively, you could rethink why and when you need the date, identify an
appropriate event (maybe the form's OnCurrent event), and fetch it through
code in the chosen event procedure by simple use of: dtmToday = Date
--
Cheers
 Graham


Quote:
> I am having trouble with a module I wrote to return the current date, when
> the date changes at midnite.  I am using the module in a form as a custom
> counter. The counter returns the Julian day of year and a sequencial
number.
> When the date changes the counter is reset to 1.  The difficulty I am
having
> is that the form / module returns the date the form was opened and will
not
> update to the 'true/new day' current system date until the form is closed
> and reopened.  I suppose that I could close the form and reopen it when
the
> user goes to a new record, but I would think there is a better way to get
> the 'true' current system date when the date changes while a form is open.



Fri, 28 Dec 2001 03:00:00 GMT  
 Date change at midnite - open form
I'm not sure I'm understanding the situation correctly or not, but my first
thought was to use the timer event of the form; that is, in the FORM_TIMER
event code, check the date, and if the date is midnight (or after), refresh
the form.

Of course, this is assuming the form is bound to a table.  If the table is NOT
bound to a table and you are populating the form contents, then you can again
use the timer ideology.  Simply call your population sub-routine instead of
refreshing the form.

Hope this helps.
Chris Miller


Quote:

>I am having trouble with a module I wrote to return the current date, when
>the date changes at midnite.  I am using the module in a form as a custom
>counter. The counter returns the Julian day of year and a sequencial number.
>When the date changes the counter is reset to 1.  The difficulty I am having
>is that the form / module returns the date the form was opened and will not
>update to the 'true/new day' current system date until the form is closed
>and reopened.  I suppose that I could close the form and reopen it when the
>user goes to a new record, but I would think there is a better way to get
>the 'true' current system date when the date changes while a form is open.



Sun, 30 Dec 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Compare date in form with date/time in form with date/time in database

2. Open form, close form, open form = disposed object exception

3. Timing near midnite / BPS time estimate??

4. Help - Changing Date field format on Forms/Reports through code

5. Need Help Changing date format in a form field

6. Opening a form when another form is opened

7. Open, changing then saving a value in a form in a public folder

8. change text in open form

9. how to change the textbox in a form already open in the back

10. Changing a Calculate field (Date) depending on Current date

11. ms-access - delete old dates and change dates

12. .TLB time/date stamp changes with not change to .DLL interface and binary compatibility

 

 
Powered by phpBB® Forum Software