Copy File To Another Location
Jan 20, 2006From a command button what would be the code to copy a file from one location to another i.e copy c:datasalesdata.mdb to e:databackupsalesdata.mdb
Jabez
From a command button what would be the code to copy a file from one location to another i.e copy c:datasalesdata.mdb to e:databackupsalesdata.mdb
Jabez
How easy it is to add a button to a form with a function to copy a zipped file to another location and unzip it?
View 10 Replies View RelatedI need some simple code that will copy an Excel file or a table in Access to a specific location on an FTP server. I would think this would be a very simple task, but I have yet to find any sample code that is *simple*. I have seen lots of code that requires downloading this dll or that mda, but the examples don't work. There must be something built into MS Access 2010 that will allow a file to be uploaded to an FTP site.
All the variables are known:
The FTP location (it never changes)
The FTP Username and Password (they never change)
The destination folder on the FTP site (it never changes)
The File type (it never changes)
The File name (available from the form in Access from which this will be executed)
I can either produce an output file, then copy it to the FTP site, or I can export the table directly to the FTP site with the file name for that day.
This seems to be a very simple task with no simple solution. Currently I am using an FTP app to get the file to the FTP site, but I would like to automate this. The process that creates the output file is already automated, so I would just like to add this to the existing code as its own module.
I'm looking for a simple command on the idea of:
DoCmd.FTPFile, acExel, TableName, FTPFilePath, FTPFileName, Username, Password, acUpload
just made all that above up and none of it is a real function/command in VBA, but is just the kind of thing I'm looking for.
I would think that since I can download and XML file from an FTP site that it should be child's play to upload a simple file to an FTP site, but I can't figure it out.
i had a database that allowed me from a form to store a file location for a record on a form, so i any time i could access the record, and then open the file, usually a pdf, it wasnt stored as a hyperlink, but as long text
i made the mistake of not copying the files for safe keeping when i got a permanent position..i am now back self employed, i need to recreate the database.
I'm looking for copy folder functionality and I can't find anything.
In access 2007 when I push a button on a form, I want to copy a network folder to another location and rename it.
I have a folder with Access files, subfolders, and some .vbs files in it. It requires one person to navigate through a setup process. Once the setup is completed, they need to copy the folder and its contents to a location on a shared drive, which is unknown to me and will be chosen by the user at the site. There could be many sites.
It basically works like this:
Files are downloaded to C:Program Files.
A vbscript is run and extracts a folder directly to the C:Drive and opens it. I'll call it C:Test.
The user manually moves the BE file to a shared drive.
The user opens the FE file and is walked through using the Linked Table Manager.
The user then follows a series of forms to input data.
After this, the FE closes and another DB opens.
The second DB walks them through the Linked Table Manager and closes.
Option #1 At this point I would like to have a script and have it copy that folder, C:Test, and its contents, and have a dialog box open telling the user to paste it in a location where all users have access to.
Option #2 A script that will backup the folder and all its contents to a shared location selected by the user.
Either option will l allow others to navigate to that location, copy the folder, and paste the folder to their C: Drive.
I would like to copy one (or multiple) file (-s) from a location (using applicatioin.FileDialog) and paste it in a predefined directory.
This is what I have written so far, but it doesn't work.
Code:
Dim strFil As String
Dim strURL As String
strURL = "xxxxxxxxxxxx" & Me.Internnr
strFil = Application.FileDialog(3)
strFil.allowmultiselect = True
strFil.show
FileCopy strFil, strURL
Access 2010:
The database I'm working on stores label images, or better stated, it stores file paths where the label images are stored. These paths are used in reports and forms to view the label images within the database. What I'd like to do is to create a "save" or "email" button that will allow the user to select a location to save just a copy of the image in jpg format. I realize that it is possible to imbed the jpg image into a report and export it as a pdf. What I'd really like to do is find a way to save the image (perhaps by copying it from the path in the database and simply relocating it) and preserve the jpg extension if that is possible.
I am also aware that there are third party applications that will convert pdf reports into jpg files however network restrictions keep me pretty limited in my ability to download third party software.
I need code for save dialog file ,and select the file from textbox and save it to the selected location.i have only this code and i dont know what else i can do with this because it just opens the save file dialog !
View 1 Replies View RelatedI have recently been working on the code below and I have neally completed what I want to do.
Private Sub H_Enter()
Form!H = "hyperlink#E:WORKSPEC PROJECTWORKSPECS" & Form!S & Form!PC & Form!extension & "#"
End Sub
What I want to do is have the file location (bit I have bolded) stored in another form or table and have the code read it from there as the file locations may change, rather than having to enter it for each line I just want to enter it once and then as and when it changes I just change the one line but it changes all the hyperlinks
hope this makes sense.
i have a url file location to a pdf file on the 3rd column of a listbox.
is there anyway of opening the file from a button, refering to the the highlighted record row 3rd column pdf file location
i know that me.lstBox.column(2) gets me to the column but not the code to open the pdf file for the highlighted record
any help would be appreciated
I have been searching all over on how to create an import button on a form in access 2010 where I can set which table it should copy the data into but the user could locate the import file.
NOTE: the reason being I have locked all the ribbons...
If necessary I could make a specific import template file which would have all the headings locked...
Excuse me!
i would like to know how to use browse function (like in windowXP) to select the excel file i want instead of using transferspreadsheet code.
thx!
I have a query that combines few different tables in order to create a View (Query) that is then used to by and Excel sheet to update a list. The Excel is dynamical updated when new data is inputted in the Access Tables.
But one of the fields in a query is combination of path name and report name (another filed in one of the tables) that crate a complete path to a file that contains some additional information.
Now since the Excel is updated dynamical and users of this Excel sheet are not very advanced. I waned to make it easy for them to just click on the location of the file and the file opens up. But I am not able to make the Query that contains the file destination hyperlinked.
I am using Access 2007
Access 2010
Objective?: I'm attempting to change the file location of the back end portion of my split database.
What I've done so far: I've used the linked table manager to update the back end location of all tables in the front end portion of the database.
Symptoms: When making a change to the OLD back end: If I change the name or move the old back end and then try to re-open the front end, Access opens as if I'm opening the application itself without any database associated with it until I restore the OLD back end to its appropriate state.
When making a change to the NEW back end: If I change the name or move the new Back end and then try to re-open the front end, I get a: "Could not find file" error message until I restore the new back end to it's appropriate state.
I've just discovered a query that I think put me one step closer to resolving this issue. [URL] .....
When I run this query:
Code:
SELECT MSysObjects.Database
FROM MSysObjects
GROUP BY MSysObjects.Database, MSysObjects.Type
HAVING (((MSysObjects.Type) In (4,6)));
It returns 2 results:
1. The path of my old back end
2. The path of my new back end.
Unfortunately I'm not able to update the values from the Datasheet, but this does confirm to me that the old back end is still some how being used by the front end even after my tables have all been updated.
I find the following CODE online (Print to PDF). Which work perfectly for me, the only issue and/or modification I am looking for "Popup Window to save the file at any location", instead at fixed location.
Option Compare Database
Option Explicit
Function PrintToPDF(SrcFile As String)
On Error GoTo PrintToPDF_Err
'Function can be called from any report with this: "PrintToPDF(Screen.ActiveForm.Name)"
[Code] ....
When creating an incoming inspection database, I want to set it up so when I am in a form to add data, I want to have a command button where I can pull up the associated CAD drawing based on part number and drawing number. I would like to enter the directory location into a table so I could change it if I need to.
So basically I want to go something like this:
.tblDirctoryLocation
txtDirectory
.tblProduct
txtProductName
txtProductNumber
txtProductCADNo
These tables would not be related to one another as there will only be one record for the directory location and multiple records for products.
Somehow I want the db to assemble file location like this:
“EQuality_DirectoryIncoming” & “ProductNumber_” & “CADDrawing” & “.pdf”
End result: EQuality_DirectoryIncomingProductNumber_CADDraw ing.pdf
Is there any way this could be done?
I have created a database that tracks the locations of all the faxes we receive in a day. We have a dedicated employee that enters them into the database as well as who they are assigned to and other pertinent information. At the end of the day, I monitor the network folders where the faxes are saved to change the status of the fax in the database to done, still needs processing, or awaiting approval. Is there any way that I could set up some VBA that would automatically update the status column for the record based on the location of the file? The file name is recorded in the database so then if it sees that that file is in the end folder it could automatically update the status to finished.
The response I got on another forum is as follows:
-The impression I'm getting is that you've got a database of information over here.
-And it lists the file name, but not location.
-And then you have a physical folder structure with the fax files in it.
-And there are folders for done, awaiting approval, or processing.
-So what you're looking for is something to read those folders and update the status column based on which folder it is in?
-So at the start of the day we have:
New
-Fax1.tiff
-Fax2.tiff
-Fax3.tiff
-Fax4.tiff
Finished
-
In progress
-
And at the end of the day the folders look like this:
New
-Fax1.tiff
Finished
-Fax3.tiff
-Fax4.tiff
In progress
-Fax2.tiff
And you want your code to browse those folders, and update the status of each filename based on it's folder?If the filenames are unique, you can just use VBA to open the folder, create an array of the files and then set the status. Create two separate functions, one for in progress, one for completed and call them one after the other. There'd be no need to check the current status, but you could store the wrong status if a file is duplicated, or a filename repeated.
So I have this relatively simple problem: I need to create a button that once clicked will open the Save As dialog box and allow the user to save a copy of the current database where he wishes. The filename should contain todays date in DDMM format along with some pre-set text e.g. DDMM PresetText.
I am using Access 2010.
I want to find a way to grab the text from the window that shows the location of the file using vba in Access.
View 3 Replies View RelatedI want to create a button on my form that when pressed will scan my multi page document (ADF) from my Epson WF-3540 and save it as a specified file name and folder.
View 5 Replies View RelatedI'm currently working on a database to track and inventory documents in my organization similar to a library catalog, but with a digital archive as well. I'll need the ability to "attach" documents to records in the main inventory (though using links instead of storing it in the db) and have the documents live in a centrally accessible location on our shared server.
I will need to have this function work through a few different tables and in a few different iterations, but I'm trying to work on the simplest part first, which is attaching a thumbnail/preview of a given document to the record for that document.
I've got some VBA working well which opens the file picker and copies the file to a directory relative to the DB. It also creates a folder with each employee's ID number if it doesn't exist already (which it gets from the Windows log in) and adds "Copied_" to the front of the file.
Now I'm trying to get the VBA code to interact with the record. Presumably I need to tell the form button I'm using to launch the VBA code to pass the primary key of the record being displayed to VBA. Then, at the end of the VBA code I need to take that value and find the record again from VBA so I can update the MediaThumbnailLink in the original record.
Does this order of operations make sense? If so, how should I go about passing these values back and forth and writing the new link value?
Here's the VBA I'm using so far...
Code:
Option Compare Database
Public Sub GoCopyThumbnail()
Dim fDialog As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
Dim LUser As String
[Code] ....
I would like to create a form that allows me to search for a folder on my desk top, then once located i can transfer that file to a specific location on another drive, Similar to the Browse / upload function you see on many applications.I am using Access 2003. Is this possible??
View 5 Replies View RelatedI have a field named Location of type Hyperlink. I have copied the respective filepaths in those location column.The location filed looks like
M:New1234.pdf
M:New1111.pdf
M:New2222pdf
M:New4444pdf
If the user clicks on this link then the respective file should be open..I don't want the front end users to see the entire path. So, I would like to have the names as 1234.pdf in the location column instead of M:New1234.pdf. Is it possible to hide the entire path in the backend and show only the name of the file. so that if users click on 1234.pdf then the file needs to open.
In the access form I want to add a button with a special functionality.
After clicking "Select file" button special window should be open (or something else). It should give user a possibility of files locating (doc, pdf, rtf, txt ...).
After selecting the file and confirm the choice in the table "File_location" in database path to the file should be saved .
Would it be ok just to make a copy of the BE file (every so often) rather than to make a copy via code?The user can then just paste over the original if it becomes corrupt.
View 4 Replies View Related