DateDiff Help Required

murphy485

New member
Local time
Today, 07:32
Joined
May 9, 2013
Messages
5
Hi I'm new to these forums and not the greatest on Access so any help is muchly appreciated.

Basically I have a form with the fields 'RenewalDate' and 'DaysRemaining'. At the moment I have this in the control source of my 'DaysRemaining' field...

DateDiff("d",Now(),[RenewalDate])

However when I run my form the error '#name?' is givin within the 'DaysRemaining' field. I need any help on how to get the control source to recognise the 'RenewalDate' field. All of my names match up I just can't figure it. Any help is appreciated.

Thanks, Ben.
 
Check out the examples at
I would try Date instead of Now( which includes Day and Time)

Thanks for the reply, I have looked at those earlier on. When I specify two dates in my formula such as...

DateDiff("d",date(),#21/05/2013#)

It works fine. However I need it to recognise my field and every time I switch the date to [Field], it just comes up with #name? error and I can't get my head around it.
 
Make sure that the field RenewalDate is present in the Form's RecordSource, and is not Null..
 
Where exactly are you using this construct?
It sounds like Access doesn't know/understand your [Field].

Is this in a query, or on a form? Please give us more info.
 
Where exactly are you using this construct?
It sounds like Access doesn't know/understand your [Field].

Is this in a query, or on a form? Please give us more info.


Hi sorry not the best on access. I want it so that it is on the form and not using a query. The code I have the moment in my 'DaysRemaining' field is:

=DateDiff("d",Date(),[RenewalDate])

The control source of the field 'RenewalDate' is 'RenewalDate' and the name of this field is the same.
 

Users who are viewing this thread

Back
Top Bottom