[AccessD] Need help with return in a function

Kaup, Chester Chester_Kaup at kindermorgan.com
Thu Apr 28 13:43:33 CDT 2016


The Dim B does not belong in the Function. Thanks for your comments.

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of James Button
Sent: Thursday, April 28, 2016 1:38 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Need help with return in a function

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

--
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