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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy a file from one location to another 1

Status
Not open for further replies.

northernbeaver

Programmer
Jul 9, 2001
164
CA
Im trying to copy a file from one location to another on a click of a button. Im running access 2000. I have tried using the following code
Code:
Dim fs As New Scripting.FileSystemObject
Set fs = New FileSystemObject



strFilter = ahtAddFilterItem(strFilter, "CAD DWG (*.DWG)", "*.DWG")
strInputFileName = ahtCommonFileOpenSave( _
                Filter:=strFilter, OpenFile:=False, _
                DialogTitle:="Please select an input file...", _
                Flags:=ahtOFN_HIDEREADONLY)
fs.CopyFile Me.CadLink, strInputFileName

but when I try to run the code I get the error "user defined type not defined" I assume that means I have to have something referenced in my references. the app that Im creating will eventually be distributed on cd so I have to be carefull as to what I use to copy the file. is there a better way?
 
Why using the FSO instead of the native VBA instruction ?
FileCopy Me.CadLink, strInputFileName

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top