• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1927
  • Last Modified:

Access 2010 no longer has FileDateTime Function

We have a program that uses this feature in access 2003.  The reports person is saying that Access 2010 no longer has this function. Is there something else in 2010 or a way to create this using VBA code?
0
kdschool
Asked:
kdschool
  • 3
  • 3
  • 2
  • +3
6 Solutions
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
What function?

Jim.
0
 
Anthony BerenguelCommented:
If you're trying to get the current date and time the function now() should work for you.

ab
0
 
Anthony BerenguelCommented:
Also, if you can provide the section of code that is causing the error that will help all of us out ;-)

thanks!

ab
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kdschoolAuthor Commented:
FileDateTime Function
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
This function IS available and does work ...
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
I just double checked and it's still there.

Jim.
0
 
mbizupCommented:
FileDateTime seems to work in my copy of Access 2010.

Are you sure
a) your syntax is correct

and

b) the file you are referring to exists

?
0
 
kdschoolAuthor Commented:
I was told it was not working in 2010 by the person doing the coding.  Can you direct me to a valid site that talks about using this in access 2010.
0
 
Jeffrey CoachmanCommented:
Yes, as MX stated, I was able to get this working as a function, but could not get it working in a query directly.

So perhaps you will need to make a function?...
In a Module do something like this:

Public Function GetFileDateTime(FullFileName as string) as date
    GetFileDateTime=FileDateTime(FullFileName)
End function

The in a query do something like this:
SELECT FullFileName, GetFileDateTime(FullFileName) AS FileDateAndTime
FROM YourTable

Then you can use this query as the Source for a Form or Report...


JeffCoachman
0
 
mbizupCommented:
Although this MS article is for Access 2007, the information for this function also applies to Access 2010:
http://office.microsoft.com/en-ca/access-help/filedatetime-function-HA001228836.aspx

<<  valid site >>

I'm assuming that you mean Microsoft...
0
 
mbizupCommented:
Jeff's right about its use in queries  - depending on your sandbox security settings, it looks like that function may be disabled in queries and property sheets (see the note about sandbox mode at the top of that article):

This discusses sandbox security in a little more detail:
http://office.microsoft.com/en-us/access-help/use-sandbox-mode-in-access-2010-HA010342092.aspx

Although this article discusses lowering the Sanbox Security level through registry settings, Jeff's method of using a 'wrapper function' is more appropriate especially if you are working on a corporate/govt network.
0
 
kdschoolAuthor Commented:
I realize I did not ask this correctly the first time and tried to reward you all.  It put the points in.  The query and sandbox are the issues and these links help a lot.
0
 
Jeffrey CoachmanCommented:
...Glad we were able to help...
;-)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now