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?
kdschoolAsked:
Who is Participating?
 
Jeffrey CoachmanMIS LiasonCommented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
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
 
kdschoolAuthor Commented:
FileDateTime Function
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
This function IS available and does work ...
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
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
 
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 CoachmanMIS LiasonCommented:
...Glad we were able to help...
;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.