February 10, 201016 yr comment_1016479 salam,kat bawah nie ialah satu sistem utuk copy files dari local folder ke shared folder.mcm mane nak refresh filelistbox tu so that setiap kali aku copy certain file ke shared folder,ia kan refresh kat filelistbox.Contohnya lau aku copy file 'a' dari drive c aku ke shared folder bernama zmyxxxxx,after copying,aku nak makesure dalam filelistbox tu , file 'a' tak wujud lagi dah.so takdelah kes user terselect file yg same lagi dahPrivate Sub cmdCpy_Click()Dim path As StringDim topath As StringDim File As StringDim directory As StringOn Error GoTo err_handler:directory = txtdest.TextFile = FileListBox.FileNamepath = DirListbox + "\" + Filetopath = directory + "\" + FileIf txtdest.Text <> "" Then FileCopy path, topath MsgBox " file succesfully copied" Else MsgBox "please specify target destination"End IfKill pathExit Suberr_handler: MsgBox ("Failed. " & Error)End SubPrivate Sub DirListbox_Change()FileListBox.path = DirListbox.pathEnd SubPrivate Sub DriveListBox_Change()Dim msg As StringDim result As StringOn Error GoTo ErrorDirListbox.path = DriveListBox.DriveExit SubError: msg = "Error: " & Err.Number & ": " & Err.Descriptionresult = MsgBox(msg, vbOKCancel + vbExclamation, "No Data")If result = vbOK ThenResumeElseDriveListBox.Drive = DirListbox.pathErr.ClearExit SubEnd IfEnd SubPrivate Sub FileListBox_Click()lblFile.Caption = FileListBox.FileNameEnd Sub Report
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.