Timer Count

G

Gee

I'm using this, that I found in another post here to have a ticking timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email after 15
minutes.
NOC is the field where I want the result...I'll be building an IF statement
based on NOC, like if NOC = 15 then send an email to Tech2..I want an email
to be sent if the difference between [CallDate] and the timer is 15 minutes.

I tried this but it just won't work, I thought that I could get the NOC
field to update if I used "Change" on the ticking timer field of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
G

Gee

OOOo! That's a GOOD idea!
I'll try it and let you know if it works.


Douglas J. Steele said:
I don't believe the Change event fires unless you actually type something
into the text box. Setting its value programmatically isn't enough. Why not
put that code in the TImer event instead?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gee said:
I'm using this, that I found in another post here to have a ticking timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email after 15
minutes.
NOC is the field where I want the result...I'll be building an IF
statement
based on NOC, like if NOC = 15 then send an email to Tech2..I want an
email
to be sent if the difference between [CallDate] and the timer is 15
minutes.

I tried this but it just won't work, I thought that I could get the NOC
field to update if I used "Change" on the ticking timer field of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
G

Gee

It changes!!
However, instead of the "n" working and getting a count of the difference in
minutes I'm getting a number like -57559329.
I've got the field set as "Number".
What am I doing wrong?

Gee said:
OOOo! That's a GOOD idea!
I'll try it and let you know if it works.


Douglas J. Steele said:
I don't believe the Change event fires unless you actually type something
into the text box. Setting its value programmatically isn't enough. Why not
put that code in the TImer event instead?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gee said:
I'm using this, that I found in another post here to have a ticking timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email after 15
minutes.
NOC is the field where I want the result...I'll be building an IF
statement
based on NOC, like if NOC = 15 then send an email to Tech2..I want an
email
to be sent if the difference between [CallDate] and the timer is 15
minutes.

I tried this but it just won't work, I thought that I could get the NOC
field to update if I used "Change" on the ticking timer field of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
D

Douglas J. Steele

How does CallDate get its value?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Gee said:
It changes!!
However, instead of the "n" working and getting a count of the difference
in
minutes I'm getting a number like -57559329.
I've got the field set as "Number".
What am I doing wrong?

Gee said:
OOOo! That's a GOOD idea!
I'll try it and let you know if it works.


Douglas J. Steele said:
I don't believe the Change event fires unless you actually type
something
into the text box. Setting its value programmatically isn't enough. Why
not
put that code in the TImer event instead?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using this, that I found in another post here to have a ticking
timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email after
15
minutes.
NOC is the field where I want the result...I'll be building an IF
statement
based on NOC, like if NOC = 15 then send an email to Tech2..I want an
email
to be sent if the difference between [CallDate] and the timer is 15
minutes.

I tried this but it just won't work, I thought that I could get the
NOC
field to update if I used "Change" on the ticking timer field of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
G

Gee

CallDate is a DateTime field and gets it's value when a new call is opened
there is a field called Today and it's "=NOW()". CallDate is populated by
that field.


Douglas J. Steele said:
How does CallDate get its value?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Gee said:
It changes!!
However, instead of the "n" working and getting a count of the difference
in
minutes I'm getting a number like -57559329.
I've got the field set as "Number".
What am I doing wrong?

Gee said:
OOOo! That's a GOOD idea!
I'll try it and let you know if it works.


:

I don't believe the Change event fires unless you actually type
something
into the text box. Setting its value programmatically isn't enough. Why
not
put that code in the TImer event instead?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using this, that I found in another post here to have a ticking
timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email after
15
minutes.
NOC is the field where I want the result...I'll be building an IF
statement
based on NOC, like if NOC = 15 then send an email to Tech2..I want an
email
to be sent if the difference between [CallDate] and the timer is 15
minutes.

I tried this but it just won't work, I thought that I could get the
NOC
field to update if I used "Change" on the ticking timer field of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
D

Douglas J. Steele

Populated where? What you had before was

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

and there's no way that CallDate would be getting its value set.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Gee said:
CallDate is a DateTime field and gets it's value when a new call is opened
there is a field called Today and it's "=NOW()". CallDate is populated by
that field.


Douglas J. Steele said:
How does CallDate get its value?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Gee said:
It changes!!
However, instead of the "n" working and getting a count of the
difference
in
minutes I'm getting a number like -57559329.
I've got the field set as "Number".
What am I doing wrong?

:

OOOo! That's a GOOD idea!
I'll try it and let you know if it works.


:

I don't believe the Change event fires unless you actually type
something
into the text box. Setting its value programmatically isn't enough.
Why
not
put that code in the TImer event instead?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using this, that I found in another post here to have a
ticking
timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email
after
15
minutes.
NOC is the field where I want the result...I'll be building an IF
statement
based on NOC, like if NOC = 15 then send an email to Tech2..I want
an
email
to be sent if the difference between [CallDate] and the timer is
15
minutes.

I tried this but it just won't work, I thought that I could get
the
NOC
field to update if I used "Change" on the ticking timer field of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
G

Gee

It's on another form.
CallDate is populated when a call comes in and is entered into the db
through a front end that all the sales people use.
I have a split db.
I'm working on the timer in a second front end. What I'm trying to do is
when a call comes in and is entered into the database, this second front end,
which stays open, will have a form that starts a count down. If the counter
reaches 15 and the call has not been responded to, an email will go to
Tech1...if the counter reaches 30 and the call has not been responded to, and
email will go to Tech2.

Douglas J. Steele said:
Populated where? What you had before was

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

and there's no way that CallDate would be getting its value set.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Gee said:
CallDate is a DateTime field and gets it's value when a new call is opened
there is a field called Today and it's "=NOW()". CallDate is populated by
that field.


Douglas J. Steele said:
How does CallDate get its value?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


It changes!!
However, instead of the "n" working and getting a count of the
difference
in
minutes I'm getting a number like -57559329.
I've got the field set as "Number".
What am I doing wrong?

:

OOOo! That's a GOOD idea!
I'll try it and let you know if it works.


:

I don't believe the Change event fires unless you actually type
something
into the text box. Setting its value programmatically isn't enough.
Why
not
put that code in the TImer event instead?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using this, that I found in another post here to have a
ticking
timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email
after
15
minutes.
NOC is the field where I want the result...I'll be building an IF
statement
based on NOC, like if NOC = 15 then send an email to Tech2..I want
an
email
to be sent if the difference between [CallDate] and the timer is
15
minutes.

I tried this but it just won't work, I thought that I could get
the
NOC
field to update if I used "Change" on the ticking timer field of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
D

Douglas J. Steele

If it's populated on another form, I suspect this form knows nothing about
it.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Gee said:
It's on another form.
CallDate is populated when a call comes in and is entered into the db
through a front end that all the sales people use.
I have a split db.
I'm working on the timer in a second front end. What I'm trying to do is
when a call comes in and is entered into the database, this second front
end,
which stays open, will have a form that starts a count down. If the
counter
reaches 15 and the call has not been responded to, an email will go to
Tech1...if the counter reaches 30 and the call has not been responded to,
and
email will go to Tech2.

Douglas J. Steele said:
Populated where? What you had before was

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

and there's no way that CallDate would be getting its value set.


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Gee said:
CallDate is a DateTime field and gets it's value when a new call is
opened
there is a field called Today and it's "=NOW()". CallDate is populated
by
that field.


:

How does CallDate get its value?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


It changes!!
However, instead of the "n" working and getting a count of the
difference
in
minutes I'm getting a number like -57559329.
I've got the field set as "Number".
What am I doing wrong?

:

OOOo! That's a GOOD idea!
I'll try it and let you know if it works.


:

I don't believe the Change event fires unless you actually type
something
into the text box. Setting its value programmatically isn't
enough.
Why
not
put that code in the TImer event instead?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using this, that I found in another post here to have a
ticking
timer:

Private Sub Form_Timer()
Dim currentTime As Date
currentTime = Format(Now(), "h:m:s")
Me.txtCurrentTime.Value = currentTime
End Sub

It works fine, except what I need it for is to trigger an email
after
15
minutes.
NOC is the field where I want the result...I'll be building an
IF
statement
based on NOC, like if NOC = 15 then send an email to Tech2..I
want
an
email
to be sent if the difference between [CallDate] and the timer
is
15
minutes.

I tried this but it just won't work, I thought that I could get
the
NOC
field to update if I used "Change" on the ticking timer field
of
txtCurrentTime:

Private Sub txtCurrentTime_Change()
NOC = DateDiff("n", [CallDate], [txtCurrentTime])
End Sub

Thank you in advance for any help,
Gee
 
G

Gee

They're both linked to the same Table in the Backend.
All the calls show up on the new form and the "CallDate" info is there and
correct.
I just can't get the difference between "CallDate" and the timer to show up
as a difference in minutes.
 
G

Gee

I figured it out!
I put TimeValue in, like this:

NOC = DateDiff("n", TimeValue(CallDate), TimeValue(txtCurrentTime))
 

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

Update ALL records 1
Update Open Form 3
Send Email 2
Send Email If 5
Sending An Email 4
Cancel timer event if criteria not met 1
Understanding Timer Pause Code 6
Sending 3 email? 9

Top