[AccessD] Need help with return in a function
James Button
jamesbutton at blueyonder.co.uk
Thu Apr 28 13:38:10 CDT 2016
I suspect that the return value maybe needs to be numeric,
And maybe the test needs to be in a () set.
Also worth considering that afile may be a string
and contain imbedded spaces,
and maybe longer than 255 characters ( the basic/normal windows filename API
limit )
Also what is B used for
JimB
-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup,
Chester
Sent: Thursday, April 28, 2016 6:56 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Need help with return in a function
Came across a bit of code in a database and I don't understand what one line is
supposed to do or how it is intended to work. I get a syntax error of
"Expected end of statement" The line in question is return Len(Dir$(aFile)) >0.
Thanks for the assistance.
Here is the whole function
Function Delete_File(aFile)
Dim B As String
On Error Resume
Kill aFile
On Error GoTo 0
return Len(Dir$(aFile)) > 0 ' Make sure it actually got deleted.
End Function
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
More information about the AccessD
mailing list