Add Number of Dates that Equal Today (ignore the rest)

R

Rod

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
K

Klatuu

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)
 
R

Rod

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

Klatuu said:
I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

Rod said:
Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
K

Klatuu

Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

Rod said:
I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

Klatuu said:
I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

Rod said:
Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
R

Rod

I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

Klatuu said:
Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

Rod said:
I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

Klatuu said:
I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
K

Klatuu

I just had a thought. Date/Time fields can have different formats. Could be
General date, Long Date, Short Date, Long Time, Short time.

If the date format in your query is not the same as the date format in the
table, it will not return anything.

For example =Date() = Now() will return False

Rod said:
I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

Klatuu said:
Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

Rod said:
I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
R

Rod

here is what I did:
1) I confirmed the table is set for short
2) I created text158 and made sure its format was set to short
3) I inserted the formula in event On Dirty of text158:

Private Sub tbxCALLED_ON_Dirty(Cancel As Integer)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date), 0)
End Sub

No error, but no value either.

Klatuu said:
I just had a thought. Date/Time fields can have different formats. Could be
General date, Long Date, Short Date, Long Time, Short time.

If the date format in your query is not the same as the date format in the
table, it will not return anything.

For example =Date() = Now() will return False

Rod said:
I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

Klatuu said:
Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
K

Klatuu

I don't know what else to say, Rod. I have been doing some experimenting
here. As soon as I can find a solution, I'll get back to you.

Rod said:
here is what I did:
1) I confirmed the table is set for short
2) I created text158 and made sure its format was set to short
3) I inserted the formula in event On Dirty of text158:

Private Sub tbxCALLED_ON_Dirty(Cancel As Integer)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date), 0)
End Sub

No error, but no value either.

Klatuu said:
I just had a thought. Date/Time fields can have different formats. Could be
General date, Long Date, Short Date, Long Time, Short time.

If the date format in your query is not the same as the date format in the
table, it will not return anything.

For example =Date() = Now() will return False

Rod said:
I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

:

Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
K

Klatuu

Okay, try it this way:
Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = Date()"), 0)

Rod said:
I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

Klatuu said:
Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

Rod said:
I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
R

Rod

No change:
Private Sub Text158_Dirty(Cancel As Integer)
' Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date), 0)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
Date()"), 0)
End Sub


Klatuu said:
Okay, try it this way:
Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = Date()"), 0)

Rod said:
I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

Klatuu said:
Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
K

Klatuu

It worked fine on my system. I don't know what else to do.

Rod said:
No change:
Private Sub Text158_Dirty(Cancel As Integer)
' Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date), 0)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
Date()"), 0)
End Sub


Klatuu said:
Okay, try it this way:
Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = Date()"), 0)

Rod said:
I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

:

Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
R

Rod

You are using "Short Date"?

Klatuu said:
It worked fine on my system. I don't know what else to do.

Rod said:
No change:
Private Sub Text158_Dirty(Cancel As Integer)
' Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date), 0)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
Date()"), 0)
End Sub


Klatuu said:
Okay, try it this way:
Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = Date()"), 0)

:

I have honestly worked on this; I'm not having any luck. I see what you mean
about returning 0. I have played with formatting in the table (date/time
format - nothing special). No luck in the properties on CALLED_ON either.

:

Interesting, is should return 0 if it finds nothing. it may be the
formatting of the date in the table. You did not say what kind of database
or what the format is. I would suggest you go into VBA editor, and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date), 0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date (haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which equal today only,
e.g. if today there were 50 calls, at midnight it would rollover to 0 because
new day and no calls made at midnight. I woul dlike to not store the result,
but display it in control on a form named "Calls_Today". If possible, I
would like this calculated on this same form and updated everytime a new
record is opened.

Thanks,
Rod
 
D

Douglas J. Steele

Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", _
"[CALLED_ON] = " & Format(Date(), "\#mm\/dd\/yyyy\#"), 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Rod said:
You are using "Short Date"?

Klatuu said:
It worked fine on my system. I don't know what else to do.

Rod said:
No change:
Private Sub Text158_Dirty(Cancel As Integer)
' Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = "
&
Date), 0)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
Date()"), 0)
End Sub


:

Okay, try it this way:
Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = Date()"), 0)

:

I have honestly worked on this; I'm not having any luck. I see
what you mean
about returning 0. I have played with formatting in the table
(date/time
format - nothing special). No luck in the properties on CALLED_ON
either.

:

Interesting, is should return 0 if it finds nothing. it may be
the
formatting of the date in the table. You did not say what kind
of database
or what the format is. I would suggest you go into VBA editor,
and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date),
0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES",
"[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date
(haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current
event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES",
"[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add
up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which
equal today only,
e.g. if today there were 50 calls, at midnight it would
rollover to 0 because
new day and no calls made at midnight. I woul dlike to not
store the result,
but display it in control on a form named "Calls_Today".
If possible, I
would like this calculated on this same form and updated
everytime a new
record is opened.

Thanks,
Rod
 
R

Rod

Excellent!

After working on this problem all day, I got as far as figuring out why I
was getting an improper use of NULL error; CALLED_ON was coming into the
formula as NULL. I was just about to give up on this one when your solution
came in. I fixed one missing ")" before ", 0)" and it worked!

Thanks for being there!

Douglas J. Steele said:
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", _
"[CALLED_ON] = " & Format(Date(), "\#mm\/dd\/yyyy\#"), 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Rod said:
You are using "Short Date"?

Klatuu said:
It worked fine on my system. I don't know what else to do.

:

No change:
Private Sub Text158_Dirty(Cancel As Integer)
' Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = "
&
Date), 0)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
Date()"), 0)
End Sub


:

Okay, try it this way:
Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = Date()"), 0)

:

I have honestly worked on this; I'm not having any luck. I see
what you mean
about returning 0. I have played with formatting in the table
(date/time
format - nothing special). No luck in the properties on CALLED_ON
either.

:

Interesting, is should return 0 if it finds nothing. it may be
the
formatting of the date in the table. You did not say what kind
of database
or what the format is. I would suggest you go into VBA editor,
and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " & Date),
0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES",
"[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current date
(haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current
event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES",
"[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to add
up all of the
dates in "CALLED_ON" throughout the table tblRESUMES which
equal today only,
e.g. if today there were 50 calls, at midnight it would
rollover to 0 because
new day and no calls made at midnight. I woul dlike to not
store the result,
but display it in control on a form named "Calls_Today".
If possible, I
would like this calculated on this same form and updated
everytime a new
record is opened.

Thanks,
Rod
 
D

Douglas J. Steele

Oops, sorry about the typo!

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Rod said:
Excellent!

After working on this problem all day, I got as far as figuring out why I
was getting an improper use of NULL error; CALLED_ON was coming into the
formula as NULL. I was just about to give up on this one when your
solution
came in. I fixed one missing ")" before ", 0)" and it worked!

Thanks for being there!

Douglas J. Steele said:
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", _
"[CALLED_ON] = " & Format(Date(), "\#mm\/dd\/yyyy\#"), 0)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Rod said:
You are using "Short Date"?

:

It worked fine on my system. I don't know what else to do.

:

No change:
Private Sub Text158_Dirty(Cancel As Integer)
' Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
"
&
Date), 0)
Me.Text158 = Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] =
Date()"), 0)
End Sub


:

Okay, try it this way:
Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = Date()"), 0)

:

I have honestly worked on this; I'm not having any luck. I see
what you mean
about returning 0. I have played with formatting in the table
(date/time
format - nothing special). No luck in the properties on
CALLED_ON
either.

:

Interesting, is should return 0 if it finds nothing. it may
be
the
formatting of the date in the table. You did not say what
kind
of database
or what the format is. I would suggest you go into VBA
editor,
and enter the
function part:
? Nz(DCount([CALLED_ON], "tblRESUMES", "[CALLED_ON] = " &
Date),
0)
and play with it until you get the correct results.

:

I get an "Invalid use of NULL" when I applied it to

Private Sub tbxCALLED_ON_Change()
Me.txtCalls_Today = Nz(DCount([CALLED_ON], "tblRESUMES",
"[CALLED_ON] =
" & Date), 0)
End Sub

I would like to have tbxCALLED_ON default to the current
date
(haven't
figured that out yet), perhaps that would kill two birds...

:

I think the best place for the code would be the current
event of the form.
It would go something like this:

Me.txtCallsToday = Nz(DCount([CALLED_ON], "tblRESUMES",
"[CALLED_ON] = " &
Date()),0)

:

Hello,

I have a Date/Time named "CALLED_ON". I would like to
add
up all of the
dates in "CALLED_ON" throughout the table tblRESUMES
which
equal today only,
e.g. if today there were 50 calls, at midnight it would
rollover to 0 because
new day and no calls made at midnight. I woul dlike to
not
store the result,
but display it in control on a form named "Calls_Today".
If possible, I
would like this calculated on this same form and updated
everytime a new
record is opened.

Thanks,
Rod
 

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

Top