|
-
Jan 17th, 2003, 06:30 AM
#1
Thread Starter
Addicted Member
Entering the file name in a text box if the filename exists
Can anyone tell me the exact code
line by line
for entering the file name in a text box
and file exists
else msg box "File Not Found"
if a file name r.txt s entered in text box it should
display the message it exists else Not Found
Regds
Sam F.
-
Jan 17th, 2003, 06:40 AM
#2
Registered User
This will only work in the current directory, will not search all drivers and directories!
VB Code:
Private Sub Command1_Click()
If Not (Len(Dir$(Text1.Text)) <> 0) Then
MsgBox ("The File Does not exist")
Else
MsgBox ("The File exists")
End If
End Sub
I hope its what you were looking for
-
Jan 17th, 2003, 06:42 AM
#3
Registered User
I think this makes more sence 
VB Code:
Private Sub Command1_Click()
If (Len(Dir$(Text1.Text)) = 0) Then
MsgBox ("File Not Found")
Else
MsgBox ("File Found")
End If
End Sub
-
Jan 20th, 2003, 12:22 PM
#4
Thread Starter
Addicted Member
Entering the file name in a text box if the filename exists ERROR
If (Len(Dir$(Text1.Text)) = 0) Then
MsgBox ("File Not Found")
Else
MsgBox ("File Found")
End If
whenever i type a anyting it gives MSGbox File Not Found
Regds
Sam F.
-
Jan 20th, 2003, 01:34 PM
#5
Registered User
Re: Entering the file name in a text box if the filename exists ERROR
Originally posted by samf
If (Len(Dir$(Text1.Text)) = 0) Then
MsgBox ("File Not Found")
Else
MsgBox ("File Found")
End If
whenever i type a anyting it gives MSGbox File Not Found
Regds
Sam F.
This code will only detect the filename you type in the same directory you save this program in.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|