Timer Countdown and events

  • Thread starter Jackson via AccessMonster.com
  • Start date
J

Jackson via AccessMonster.com

Hi,

I've just started a new DB. The main form has a control Clock that simply
displays the current time and date to the second. It is live, as I put the
Timer Interval as 1000 and the On Timer procedure as [Clock] = Now

A few things:
1) I have a subquery that has records with a date and time (today's records)
and as they get say 15 minutes away from occuring I want to somehow alert the
user. Blinking text/blinking colours were my first thought and/or message
boxes. Any thoughts on how to go about this? I included a field TimeDiff in
my form which calculates the time diff between each record and the clock.

2) The timediff field doesn't update as a new minute ticks by. I thought I
could just put Me.Requery in the AfterUpdate property of my form but this
doesn't work, any thoughts as to how I accomplish this?

Any help would be most appreciated!

Regards,
Jack.
 
M

Marshall Barton

Jackson said:
I've just started a new DB. The main form has a control Clock that simply
displays the current time and date to the second. It is live, as I put the
Timer Interval as 1000 and the On Timer procedure as [Clock] = Now

A few things:
1) I have a subquery that has records with a date and time (today's records)
and as they get say 15 minutes away from occuring I want to somehow alert the
user. Blinking text/blinking colours were my first thought and/or message
boxes. Any thoughts on how to go about this? I included a field TimeDiff in
my form which calculates the time diff between each record and the clock.

2) The timediff field doesn't update as a new minute ticks by. I thought I
could just put Me.Requery in the AfterUpdate property of my form but this
doesn't work, any thoughts as to how I accomplish this?


Please explain what you mean by "subquery".

Blinking is strongly discouraged as a user interface
component. It is extremely irritating and can actually
affect the health of susceptable peaple. Can't you just use
a different back color on a text box?

If you are using a datasheet or continuous subform, then I
would expect the TimeDiff value to be calculated by a text
box expression like:
=DateDiff("n", datetimefield, Now())
If it is something like that, then you want to use Recalc
instead of Requery.

I think you can display a different color in any of your
text boxes simply by using Conditional Formatting with an
expression that refers to the TimeDiff text box.
 
J

Jackson via AccessMonster.com

Sorry,

I meant subform, not subquery (just inserted a query as subform).

Blinking wouldn't really bother us as working in financial markets and used
to it with Bloomberg etc.

I am using a text box as you said with the same sort of formula, do I just do
Me.Recalc where I have Me.Requery?

Thanks.

Marshall said:
I've just started a new DB. The main form has a control Clock that simply
displays the current time and date to the second. It is live, as I put the
[quoted text clipped - 10 lines]
could just put Me.Requery in the AfterUpdate property of my form but this
doesn't work, any thoughts as to how I accomplish this?

Please explain what you mean by "subquery".

Blinking is strongly discouraged as a user interface
component. It is extremely irritating and can actually
affect the health of susceptable peaple. Can't you just use
a different back color on a text box?

If you are using a datasheet or continuous subform, then I
would expect the TimeDiff value to be calculated by a text
box expression like:
=DateDiff("n", datetimefield, Now())
If it is something like that, then you want to use Recalc
instead of Requery.

I think you can display a different color in any of your
text boxes simply by using Conditional Formatting with an
expression that refers to the TimeDiff text box.
 
M

Marshall Barton

I guess maybe(?) subquery is closer to it than subform would
be. Regardless of what you call it, it won't do what you
want. You need a real form with controls to be able to
specify what you want. I always use a continuous subform,
but you can probably get the desired effect from a datasheet
subform.

Ok, this gets a little tricky, so stick with me as I attempt
to explain how I got this to work for me.

First, you need the TimeDiff text box to be in the subform's
detail section. Set its control source expression to:
=DateDiff("n", thedatefield, Parent.Clock)

Next, add an unbound text box named txtTick to the main
form's header section (you can make this invisible when you
don't want to see it anymore).

Use the main form's Timer event procedure to manage all this
stuff:

Me.txtClock = Now
Me.txtTick = DatePart("s", Now) Mod 2
'Me.subformcontrolname.Form.Recalc 'does entire subform
Me.subformcontrolname.Form.TimeDiff.Requery 'just text box

With all that in place, you can use Conditional Formatting
on any text box in the sub form's detai section to change
the Fore/Back Color properties. Select the Expression Is
option and enter the expression:
[TimeDiff] > 15 And Parent.[txtTick] = 0

Be very careful to switch the form to design vew before
making any design changes anywhere in your entire project.
This is important in any case to minimize the chances of
corruption, but having a timer running while trying to edit
code is just plain unworkable.
--
Marsh
MVP [MS Access]

I meant subform, not subquery (just inserted a query as subform).

Blinking wouldn't really bother us as working in financial markets and used
to it with Bloomberg etc.

I am using a text box as you said with the same sort of formula, do I just do
Me.Recalc where I have Me.Requery?


Marshall said:
I've just started a new DB. The main form has a control Clock that simply
displays the current time and date to the second. It is live, as I put the
[quoted text clipped - 10 lines]
could just put Me.Requery in the AfterUpdate property of my form but this
doesn't work, any thoughts as to how I accomplish this?

Please explain what you mean by "subquery".

Blinking is strongly discouraged as a user interface
component. It is extremely irritating and can actually
affect the health of susceptable peaple. Can't you just use
a different back color on a text box?

If you are using a datasheet or continuous subform, then I
would expect the TimeDiff value to be calculated by a text
box expression like:
=DateDiff("n", datetimefield, Now())
If it is something like that, then you want to use Recalc
instead of Requery.

I think you can display a different color in any of your
text boxes simply by using Conditional Formatting with an
expression that refers to the TimeDiff text box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

countdown timer 5
Time countdown 4
Understanding Timer Pause Code 6
Countdown timer 1
Synchronizing Timer and Computer Clock 2
countdown timer 2
Timer of Form 4
Multiple Timer Events 2

Top