Buenos Diás,
Use the following code...
If Dir(strFileName, 0) = strFileName then
Blah blah blah
End If
What this does is do a directory search for the file and if it exists the directory returns a result of the file name.
hasta luego,
Duane Hennessy.
Bandicoot Software
Tropical Queensland, Australia
(ABN: 33 682 969 957)
Want Increased Productivity?
http://www.bandicootsoftware.com.au
--- In AccessDevelopers@yahoogroups.com, "Tobi Hoffman" <[EMAIL PROTECTED]> wrote:
>
> But you need the FileExists module:
>
> Function FileExists(strFile As String) As Boolean
>
> FileExists = Not Dir(strFile) = ""
>
> End Function
>
> Tobi
>
> _____
>
> From: AccessDevelopers@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of Crosier, Dawn
> Sent: Thursday, January 12, 2006 11:43 AM
> To: AccessDevelopers@yahoogroups.com
> Subject: RE: [AccessDevelopers] Verify File Exists
>
>
> Here is some code that I have in my code library which checks to see if a
> log file exists, I am sure you can modify it to your needs. Compliments of
> Tobi Hoffman.
>
> This is in a module as a public function. Yes, I know it doesn't return
> anything, could be a Sub, but it works.
>
> Tobi Hoffman - [EMAIL PROTECTED]
>
>
>
> Function Instrumented(strError As String)
>
> ' Comments : Write all errors to a log file
>
> ' Parameters: strError-- string sent in error trap
>
> '=============================================================
>
>
>
> Dim strLog As String
>
> Dim strUser As String
>
> Dim strMsg As String
>
> Dim intFile As Integer
>
>
>
> strLog = "\\PathOnServer\AppErrorLog.log"
>
>
>
> intFile = FreeFile()
>
> If FileExists(strLog) Then
>
> Open strLog For Append As #intFile
>
> Else
>
> Open strLog For Output As #intFile
>
> End If
>
>
>
> strUser = Nz(GetUserName,"Not logged in") ' whatever function you use to get
> a user name
>
> ' strMsg gives it a timestamp, user's name, then on next line, the error you
> sent.
>
> strMsg = Now() & " " & strUser & vbCrLf & strError
>
> Print #intFile, strMsg
>
> Close intFile
>
>
>
> End Function
>
>
>
> Then in the error trap section of every module:
>
>
>
> ErrorTrap:
>
>
>
> MsgBox Err.Description
>
> Instrumented "frmSites!cmdDelete_Click: " & Err.Description
>
> Resume Exit_cmdDelete_Click
>
>
>
> End Sub
>
>
>
> Dawn Crosier
> Application Specialist
> "Education Lasts a Lifetime"
>
> This message was posted to a newsgroup. Please post replies and questions
> to the group so that others can learn as well.
>
>
> _____
>
> From: AccessDevelopers@yahoogroups.com
> [mailto:[EMAIL PROTECTED] On Behalf Of Trent Johnsey
> Sent: Wednesday, January 11, 2006 9:45 PM
> To: AccessDevelopers@yahoogroups.com
> Subject: [AccessDevelopers] Verify File Exists
>
>
> I have a situation where a needs to open an external file from an Access
> form. However, the external file could be in one of 4 formats. The file
> name will be set, but the file extension will vary. The format could be
> Excel, Word, Acrobat, or html.
>
> My problem is i am not sure how to check to see if the file exists. If the
> document exists, then I plan on opening the document using the shell
> command. Everything is fine with this process. However, I am running into
> issues determine if the file exists prior to opening it. Any assistance
> would be appreciated.
> thanks
> TJ
>
>
>
> Please zip all files prior to uploading to Files section.
>
>
>
>
> SPONSORED LINKS
> Microsoft
> <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+developer&w1=Microsoft
> +access+developer&w2=Microsoft+access+help&w3=Microsoft+access+database&w4=M
> icrosoft+access+training&w5=Microsoft+access+training+course&w6=Microsoft+ac
> cess+programming&c=6&s=193&.sig=d-CjBIrYOH9NCKHYFeGZJA> access developer
> Microsoft
> <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+help&w1=Microsoft+acce
> ss+developer&w2=Microsoft+access+help&w3=Microsoft+access+database&w4=Micros
> oft+access+training&w5=Microsoft+access+training+course&w6=Microsoft+access+
> programming&c=6&s=193&.sig=crx-d4AAhdklv_VozGVAUw> access help Microsoft
> <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+database&w1=Microsoft+
> access+developer&w2=Microsoft+access+help&w3=Microsoft+access+database&w4=Mi
> crosoft+access+training&w5=Microsoft+access+training+course&w6=Microsoft+acc
> ess+programming&c=6&s=193&.sig=qg2hDuQNweByMCX0NU7cEA> access database
> Microsoft
> <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+training&w1=Microsoft+
> access+developer&w2=Microsoft+access+help&w3=Microsoft+access+database&w4=Mi
> crosoft+access+training&w5=Microsoft+access+training+course&w6=Microsoft+acc
> ess+programming&c=6&s=193&.sig=bLZHqTqWUQny609X1OkmNA> access training
> Microsoft
> <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+training+course&w1=Mic
> rosoft+access+developer&w2=Microsoft+access+help&w3=Microsoft+access+databas
> e&w4=Microsoft+access+training&w5=Microsoft+access+training+course&w6=Micros
> oft+access+programming&c=6&s=193&.sig=d8GQXfQW3RZ64rOfzIMo8A> access
> training course Microsoft
> <http://groups.yahoo.com/gads?t=ms&k=Microsoft+access+programming&w1=Microso
> ft+access+developer&w2=Microsoft+access+help&w3=Microsoft+access+database&w4
> =Microsoft+access+training&w5=Microsoft+access+training+course&w6=Microsoft+
> access+programming&c=6&s=193&.sig=iXDlL79-kkgjv6fLyFu3Sg> access programming
>
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AccessDevelopers
> <http://groups.yahoo.com/group/AccessDevelopers> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
Please zip all files prior to uploading to Files section.
Microsoft access developer | Microsoft access help | Microsoft access database |
Microsoft access training | Microsoft access training course | Microsoft access programming |
YAHOO! GROUPS LINKS
- Visit your group "AccessDevelopers" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.