Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

save file from path

Status
Not open for further replies.

miketamp

Technical User
Jan 28, 2005
20
GR
hi
i Have a form with a textbox called "tbFile". that textbox takes file paths as value. also i have a button called "butt1". I want on the "butt1" click , the file which the file path represents on the textbox to save in the path c:\program files\dieta\.
the form's name is "input"
please help me.Thanx
 
Hi
I am not sure what you mean. Do you mean that textbox tbFile contains, eg, c:\data\filename.txt which you now want to save to c:\program files\dieta\filename.txt? If so, you could try adding:
Code:
FileCopy Me!tbFile.Text, "c:\program files\dieta\" _
& Filepart(Me!tbFile.Text)
to the OnClick event for your button, and this function to the module:
Code:
Function Filepart(str)
Filepart = Mid(str, InStrRev(str, "\") + 1)
End Function
Alternatively, you could use the FileSystemObject.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top