file search

MXC_michael
07-07-2006, 01:34 PM
hi all
how would i code a command button to search to see if a file exists and if it exist to put text1.text = "yes" and if it dont text1.text = "no" ?

thanks :D

Cerian Knight
07-07-2006, 02:49 PM
In the Command button click event write:

Dim strFileName as String
strFileName = "C:\MyDir\Myfile.ext" 'replace with your file info
If Len(Dir(strFileName)) Then
Text1.Text = "yes"
Else
Text1.Text = "no"
End If

MXC_michael
07-07-2006, 03:08 PM
thank you :D

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum