Modules & VBA :: Copy Zipped File To Another Location And Unzip

Apr 28, 2015

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 Replies


ADVERTISEMENT

Modules & VBA :: Copy Excel File Or A Table In Access To Specific Location On FTP Server

Jul 11, 2013

I 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.

View 8 Replies View Related

Modules & VBA :: Function To Unzip A File To Same Folder

Jun 26, 2014

I'm trying to write a function to unzip a file (working off Ron de Bruin's code here)..The function should take the path of the zipped file as an argument and return the path of the unzipped file (extracting to the same folder)

Code:
Public Function UnZipFile(strFile As String) As String
On Error GoTo ErrorHandler
Dim objFSO As Object
Dim objShellApp As Object
Dim strUnzipped As String

[code]...

But the code has no effect (i.e., I'm still left with just the zipped file in the folder, not the unzipped contents?) strFile is a legitimate path to an existing .zip file which contains a zipped .xls file

Code:
objShellApp.Namespace(.GetAbsolutePathName(strFile)).Items

...but found that the .Count property was 0?I've done several searches on how to unzip files using VBA and this seems to be the universally accepted method.

View 14 Replies View Related

Copy File To Another Location

Jan 20, 2006

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

View 1 Replies View Related

Attach Zipped Copy Of My Db

Feb 12, 2008

How do I attach a zipped copy of my database when asking a question?

thanks

View 9 Replies View Related

Modules & VBA :: Copy From A Location And Paste Files In A Predefined Directory

May 16, 2014

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

View 9 Replies View Related

Modules & VBA :: Allow User To Select A Location To Save Just A Copy Of Image In JPG Format

Dec 6, 2013

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.

View 2 Replies View Related

Modules & VBA :: Import Button To Ask For Location Of File

Oct 22, 2013

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...

View 4 Replies View Related

Modules & VBA :: Opening File Based On Directory Location

Feb 15, 2015

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?

View 1 Replies View Related

Modules & VBA :: Updating Records Based On File Location

Mar 3, 2015

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.

View 3 Replies View Related

Modules & VBA :: Way To Grab Text From The Window That Shows Location Of File

Jun 18, 2015

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 Related

Modules & VBA :: Scan Multiple Page PDF To A File And Directory Location?

Jan 20, 2015

I 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 Related

Modules & VBA :: Copying File To Specified Folder And Updating Records With New Location?

Jan 28, 2015

I'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] ....

View 2 Replies View Related

Modules & VBA :: Save As Dialog Box - Allow User To Save Copy Of Current Database At Desired Location

Feb 12, 2014

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.

View 2 Replies View Related

Modules & VBA :: Adding Button With Special Functionality - File Location In Database Path

May 28, 2014

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 .

View 4 Replies View Related

Modules & VBA :: Copy File From One Folder To Another

Feb 28, 2014

I need to create a function that I can launch using a macro that will copy an excel file from one folder to another in the file system.

View 4 Replies View Related

Modules & VBA :: Copy Paste Excel File From Access

Mar 31, 2015

All I need to do is copy an excel file from a location (while coping the file, the location of the source file remains same all the time)and paste that excel file where ever I want (Browser Option) from an Access VBA.

View 4 Replies View Related

Modules & VBA :: Copy File To New Directory On Button Click?

Dec 22, 2014

Is it possible in access, to create a button that will copy a file to a new directory? Specifically, the data field in question is an access hyperlink that we can click on to open a PDF drawing of a part. I just want to copy the file the hyperlink points to, into a new directory.

EX:
X:database/drawings/somefile.pdf
X:erp/drawings/somefile.pdf

I don't think a macro can do this, but perhaps vbscript can.

View 2 Replies View Related

Forms :: Storing File Location And Opening File From A Form

Dec 5, 2014

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.

View 4 Replies View Related

Modules & VBA :: Create Subfolder And Copy File - Path Is Variable

Apr 18, 2014

I have a folder which holds 1000s of pictures organised in subfolders, for example:

D:~AI Database Print Scans2009family and
D:~AI Database Print Scans2009holiday

And so forth. In total at the moment 17 main subfolders, each of which hold another 2-3 subfolders.

I am putting together a database to bring pictures together with all sorts of details. I import the picture via hyperlink and complete the various fields. All that works fine but there are a lot of pictures! And it gets confusing to see which ones have already been entered into the database and which ones haven’t.

One solution for this is to copy the pictures that have been “completed” to another folder. I have found a way to do that:

Dim fs As Object
Dim oldPath As String, newPath As String
oldPath = Forms!frmPrintDetails.txtPath1
newPath = "D:~AI Database Print ScansCompleted_Entries"
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile oldPath, newPath
Set fs = Nothing

Works fine, but the problem is that I loose the subfolder structure, it copies all pictures to the same main folder. I’d like to maintain the subfolder structure and add code to create the correct subfolders and next copy the picture. With the different paths I’m lost. I don’t know how to extract the correct path in code. I’d also like to either rename or remove the picture once I have completed entry of the details. The problem I have again is that I don’t know how to code for a changing path.

View 12 Replies View Related

General :: Copy Network Folder To Another Location And Rename It

Jul 17, 2013

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.

View 1 Replies View Related

General :: Copy A Folder To Location Selected By The User?

Sep 4, 2012

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.

View 2 Replies View Related

Modules & VBA :: Copy And Rename Excel File To Subfolder With Name Entered In Forms Control?

Jan 5, 2014

I am still trying to copy an Excel file from a parent folder to a sub-folder, that this code creates, and name the copied file with the name used to name the sub-folder, using the name entered in a control field (named 'TheDirName) of an Access 2007 form. Here is my VBA, which names the copied file "TheDirName.xlsx.:

Private Sub MakeDir_Click()
Dim appExcel As Excel.Application
Dim lngLastDataRow As Long
Dim Folder_Path As String
'Create path for customer folder & files

[code]....

View 3 Replies View Related

General :: Open Save File Dialog - Select File From Text Box And Save To Selected Location

Aug 8, 2013

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 Related

Modules & VBA :: Temporarily Map A Drive / Copy A File Then Remove Mapped Drive

Aug 29, 2014

My workaround was to temporarily map the URL to a vacant drive letter on the local machine, then copy the file over, then drop the mapped drive again. A bit clunky but doesn't incorporate much of a delay and this download only has to happen once per day.

The good news is, the file download / copy now works every time. The bad news is that removing the temporarily mapped drive after the copy has taken place, doesn't and I can't figure out why.

Here are the functions I use to map / unmap the drive :

Code:

Option Compare Database
Option Explicit

Private Const RESOURCETYPE_ANY = &H0&
Private Const CONNECT_UPDATE_PROFILE = &H1&
Private Const RESOURCE_CONNECTED As Long = &H1&

[Code] .....

I have separate functions to check existing drive mappings on the local machine and thus determine an appropriate vacant letter to use for the temporary mapping - they work fine.

Unfortunately the UnMapDrive function returns False (even though I switch the active drive to C: and force the connection to be cancelled with the fForce flag) So the mapping always remains on the users profile.

I don't want to permanently map drives on the users' profiles, just briefly for the purposes of this daily file download.

View 11 Replies View Related

Hyperlink - Changing File Location

Mar 12, 2007

I 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.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved