Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / December 2007

Tip: Looking for answers? Try searching our database.

What is an automation object error?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NewAccessUser - 29 Dec 2007 18:22 GMT
This is the error message I received when I tried to build an expression
using date parameters.  I used:

   =DateDiff("yyyy",[Date()],[Employee Listing]![Hire Date])

This is the error message:  
"The expression On Format you entered as the event property setting produced
the following error:  The object doesn't contain the Automation object
'Date().
boblarson - 29 Dec 2007 18:42 GMT
Get rid of the square brackets around Date() and also reverse the dates as
you will get a negative number if you don't:

=DateDiff("yyyy",[Employee Listing]![Hire Date],Date())

Signature

Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________

> This is the error message I received when I tried to build an expression
> using date parameters.  I used:
[quoted text clipped - 5 lines]
> the following error:  The object doesn't contain the Automation object
> 'Date().
NewAccessUser - 29 Dec 2007 18:59 GMT
Thank you for the tip.  I reversed and did not get the error message,
however, the data did not populate when I ran the report.  What am I missing?

> Get rid of the square brackets around Date() and also reverse the dates as
> you will get a negative number if you don't:
[quoted text clipped - 10 lines]
> > the following error:  The object doesn't contain the Automation object
> > 'Date().
Linq Adams - 29 Dec 2007 19:03 GMT
This is really identical to calculating a person's age, and as such the
formula

=DateDiff("yyyy",[Employee Listing]![Hire Date],Date())

will often give you false values! The problem is that DateDiff() using the
"yyyy" qualifier calculates the difference between the years in the two dates
supplied.

If you have a person hired on 12/31/2000 and you run this calculation on
1/1/2008 it will show their length of service as 8 years (2008 - 2000) when
actually their length of service is 7 years and 1 day!

For an accurate length of service try:

DateDiff("yyyy", [Employee Listing]![Hire Date], Date) - IIf(Format$(Date,
"mmdd") < Format$([Employee Listing]![Hire Date], "mmdd"), 1, 0)

Linq

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.