file browse easy

binghamw

BingleyW
Local time
Yesterday, 20:01
Joined
Apr 22, 2004
Messages
57
I have created a command button that lets the user browse to a file on a drive, and then the entire pathname and file name is displayed in the text box [Located] next to it.

Everything works perfectly, except after the closing the browse to dialog box, there is an error/debug window.

I can not figure out why it is doing this because I have the exact same code in other instance of this and it works fine.
Can anyone tell me what is wrong with this code and why it would be doing this? Here is the code:

Private Sub Command33_Click()
Dim strPath As String

'Make a search string for the type of file you want to select

'Examples:
'Excel Files & All Files... CDSearchString = MakeFilterString("Excel Files (*.xls)", "*.xls", "All Files (*.*)", "*.*")
'Word Files... CDSearchString = MakeFilterString("Word Documents (*.doc)", "*.doc", "Text Files (*.txt)", "*.txt", "All Files (*.*)", "*.*")
'Graphic Files... CDSearchString = MakeFilterString("Graphic Files (*.bmp;*.gif;*.jpg;*.wmf)", "*.bmp;*.gif;*.jpg;*.wmf")

CDSearchString = MakeFilterString("All Files (*.*)", "*.*")

'Set the Caption on the Dialog Box
CDCaption = "Select File to Attach..."

If IsNull([Located]) Or Me.Located = "" Then
CDInitDir = "\\Zeus\SharedData\GIS\"
Else
CDInitDir = [Located]
End If

strPath = LaunchCD(Me)
If Not strPath = "None Selected" Then
Me.Located = strPath
End If
If IsNull([Located]) Then
Me.txtDatePost = ""
Else
Me.txtDatePost = FileDateTime(Located)
End If
End Sub


Thanks.
 
I think the reason it's doing this is because you h ave to select a file... otherwise there is an error. I dont' think this is a problem.

Thanks anyways,


Bingley
 

Users who are viewing this thread

Back
Top Bottom