Getting Number Of Days

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I set up form to find the number of days between Charge Date and Current
Date.The following is how I have it set up.(Both date fields are formated for
short dates):
Charge Date (inputted Date) Current Date ( Date()) and No Days
(=DateDiff("d",[Charge-Off Date],[Current Date]))

I am getting a NAME# in the No Days. Can anyone tell me what is the problem?

Thanks!
 
You should be able to set your control source to:
=DateDiff("d",[Charge-Off Date],[Current Date])
or

=DateDiff("d",[Charge-Off Date],Date())

Make sure the name of the control is not the name of a field.
 
I am like you I thought it should work. It will work one time until I save
the form and then it gives me the error. Any ideas???????

Duane Hookom said:
You should be able to set your control source to:
=DateDiff("d",[Charge-Off Date],[Current Date])
or

=DateDiff("d",[Charge-Off Date],Date())

Make sure the name of the control is not the name of a field.

--
Duane Hookom
MS Access MVP

jrp444 said:
I set up form to find the number of days between Charge Date and Current
Date.The following is how I have it set up.(Both date fields are formated
for
short dates):
Charge Date (inputted Date) Current Date ( Date()) and No Days
(=DateDiff("d",[Charge-Off Date],[Current Date]))

I am getting a NAME# in the No Days. Can anyone tell me what is the
problem?

Thanks!
 
Does the expression work for some records but not others? Do you have date
values in all necessary fields?

--
Duane Hookom
MS Access MVP

jrp444 said:
I am like you I thought it should work. It will work one time until I save
the form and then it gives me the error. Any ideas???????

Duane Hookom said:
You should be able to set your control source to:
=DateDiff("d",[Charge-Off Date],[Current Date])
or

=DateDiff("d",[Charge-Off Date],Date())

Make sure the name of the control is not the name of a field.

--
Duane Hookom
MS Access MVP

jrp444 said:
I set up form to find the number of days between Charge Date and
Current
Date.The following is how I have it set up.(Both date fields are
formated
for
short dates):
Charge Date (inputted Date) Current Date ( Date()) and No Days
(=DateDiff("d",[Charge-Off Date],[Current Date]))

I am getting a NAME# in the No Days. Can anyone tell me what is the
problem?

Thanks!
 
I found that if I took out the EXIT button it works. But with the EXIT
button in the form it gives me this error and will not exit but gives me an
error message. This made no sense to me.

Duane Hookom said:
Does the expression work for some records but not others? Do you have date
values in all necessary fields?

--
Duane Hookom
MS Access MVP

jrp444 said:
I am like you I thought it should work. It will work one time until I save
the form and then it gives me the error. Any ideas???????

Duane Hookom said:
You should be able to set your control source to:
=DateDiff("d",[Charge-Off Date],[Current Date])
or

=DateDiff("d",[Charge-Off Date],Date())

Make sure the name of the control is not the name of a field.

--
Duane Hookom
MS Access MVP

I set up form to find the number of days between Charge Date and
Current
Date.The following is how I have it set up.(Both date fields are
formated
for
short dates):
Charge Date (inputted Date) Current Date ( Date()) and No Days
(=DateDiff("d",[Charge-Off Date],[Current Date]))

I am getting a NAME# in the No Days. Can anyone tell me what is the
problem?

Thanks!
 
Sounds like either a corruption or references issue. Check
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html.

--
Duane Hookom
MS Access MVP

jrp444 said:
I found that if I took out the EXIT button it works. But with the EXIT
button in the form it gives me this error and will not exit but gives me
an
error message. This made no sense to me.

Duane Hookom said:
Does the expression work for some records but not others? Do you have
date
values in all necessary fields?

--
Duane Hookom
MS Access MVP

jrp444 said:
I am like you I thought it should work. It will work one time until I
save
the form and then it gives me the error. Any ideas???????

:

You should be able to set your control source to:
=DateDiff("d",[Charge-Off Date],[Current Date])
or

=DateDiff("d",[Charge-Off Date],Date())

Make sure the name of the control is not the name of a field.

--
Duane Hookom
MS Access MVP

I set up form to find the number of days between Charge Date and
Current
Date.The following is how I have it set up.(Both date fields are
formated
for
short dates):
Charge Date (inputted Date) Current Date ( Date()) and No Days
(=DateDiff("d",[Charge-Off Date],[Current Date]))

I am getting a NAME# in the No Days. Can anyone tell me what is the
problem?

Thanks!
 
I appreciate the help. The article was very useful.

Thanks!!!!!

Duane Hookom said:
Sounds like either a corruption or references issue. Check
http://www.accessmvp.com/djsteele/AccessReferenceErrors.html.

--
Duane Hookom
MS Access MVP

jrp444 said:
I found that if I took out the EXIT button it works. But with the EXIT
button in the form it gives me this error and will not exit but gives me
an
error message. This made no sense to me.

Duane Hookom said:
Does the expression work for some records but not others? Do you have
date
values in all necessary fields?

--
Duane Hookom
MS Access MVP

I am like you I thought it should work. It will work one time until I
save
the form and then it gives me the error. Any ideas???????

:

You should be able to set your control source to:
=DateDiff("d",[Charge-Off Date],[Current Date])
or

=DateDiff("d",[Charge-Off Date],Date())

Make sure the name of the control is not the name of a field.

--
Duane Hookom
MS Access MVP

I set up form to find the number of days between Charge Date and
Current
Date.The following is how I have it set up.(Both date fields are
formated
for
short dates):
Charge Date (inputted Date) Current Date ( Date()) and No Days
(=DateDiff("d",[Charge-Off Date],[Current Date]))

I am getting a NAME# in the No Days. Can anyone tell me what is the
problem?

Thanks!
 

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 Error 1
Update SQL 1
Excel Message box with days of month & date. 1
Number of days between 2 dates 7
Number of days 9
SQL Mix up? 3
IIf statement in Access 2003 query 9
Dcount returning no results!!! 0

Back
Top