unspecified directory path

Curry

Registered User.
Local time
Tomorrow, 08:25
Joined
Jul 21, 2003
Messages
73
Hi All,

Below is some code I am using to check that a selected DB is the appropriate DB to import a data table. I use a public function PromptFileName() to select the DB and the path of where it may be sitting, which could be any where a user saves it. I want the selection to be checked before it proceeds with the rest of my code.

Therefore strFileName must equal *(Some Path)*\Schedule_Update.mdb

The path is irrelevant but the file name is crucial. I have tried putting in Wild cards *.* in place of the path preceeding the file name without any luck.

Dim strFileName

strFileName = PromptFileName()

If strFileName <> "*.*\Schedule_Update.mdb" Then
MsgBox "This is the Incorrect File"
Exit Sub
End If

Any help would be great.

Thanks
Curry
 
Curry,

-----
IF RIGHT(strFileName,19) <> "Schedule_Update.mdb" Then
MsgBox "This is the Incorrect File"
Exit Sub
End If
-----
this should work
regards .. Peter
 
This Works perfectly....Thanks for your help...

:)

Curry
 

Users who are viewing this thread

Back
Top Bottom