[RESOLVED] help me debugg this please
i want the code to collect from a folder and send it to cdlsave.Dir
1 Code:
Private Sub cmddownload_Click()
Dim strSourceFileName As String
Dim strDestination As String
On Error GoTo ERR_Handler
strSourceFileName = App.Path & "\server\" & Mid(strSourceFileName, InStrRev(strSourceFileName, "\") + 1)
strDestination = cdlsave.FileName
FileSystem.FileCopy strSourceFileName, strDestination
Exit Sub
ERR_Handler:
MsgBox "An error has occured while copying file. Operation aborted.", vbExclamation, "File Copy Error"
Err.Clear
End Sub
Private Sub cmdsave_Click()
'upload file link into database
cdlsave.DialogTitle = "Upload File"
cdlsave.Filter = "All Files(*.*)|*.*|Office Document 1997-2000(*.doc)|*.doc|Office Document 2003-2010(*.docx)|*.docx|"
cdlsave.Flags = cdlOFNFileMustExist + cdlOFNPathMustExist
cdlsave.ShowSave
txtsave.Text = cdlsave.FileTitle
End Sub
Re: help me debugg this please
How can we debug it if you don't tell us what the problem is exactly? Are you getting an error? If so, what is the error message, what line is generating the error etc.
Re: help me debugg this please
This is yet another duplicate of:
http://www.vbforums.com/showthread.php?t=627184
and
http://www.vbforums.com/showthread.php?t=627256
If you keep to the original thread (or at least make a reference to it) we can all see the history of the problem, what's been tried and what's been suggested. By creating new threads for effecitvely the same question you are making it very difficult for us to answer, which can mean we just wont bother to try.
As baja_yu has said, please tell us the exact error message you are receiving, or describe the exact problem you are experiencing - that gives us a fighting chance to suggest a resolution.
Re: help me debugg this please
Definitely let us know what the error is.
Here is one of your problems.
Code:
strSourceFileName = App.Path & "\server\" & Mid(strSourceFileName, InStrRev(strSourceFileName, "\") + 1)
Why a problem? strSourceFileName is declared in the same routine, therefore it has initial value of an empty string. The above line of code is same as this
Code:
strSourceFileName = App.Path & "\server\" & Mid("", InStrRev("", "\") + 1)
1 Attachment(s)
Re: help me debugg this please
Thanks alot guys find attached the conclusion of my Project work. if u have any comment to give about it please feel free to do so..
Thanks