dir list box etc

Kraggoth
09-01-2003, 04:56 AM
hi, on frm1 iv got a drive list box, a dir list box and a file list box, how do i set them up to link to one another? and how do i set a text box on frmB to whatever is selected in the file list box when a button is clicked,

cheers :D

gundavarapu
09-01-2003, 05:19 AM
Its very basic.


Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
Text1.Text = File1.Path & "\" & File1.FileName
End Sub

Modify this code to accomplish your task.

Squishy
09-01-2003, 07:55 PM
You probably need some code to check if the file is in the root directory of a drive (or you get something like "C:\\text.txt").

Private Sub File1_Click()
If Right(File1.Path, 1) = "\" Then
Text1.Text = File1.Path & File1.FileName
Else
Text1.Text = File1.Path & "\" & File1.FileName
End If

End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum