In this video you’ll find out how to write a recordset to a file with VBA using the Microsoft Scripting Object. You’ll find out how to take your table data, and export it to a csv formatted file so you can share it with other applications. Use this method to get your data out of […]
XML is used to structure your data. You can send a CSV file to another person, but using XML, you can structure your data in a more elegant format, and get very specific about your fields, and what data is contained within your tags (your field names). This is different than a basic CSV file […]
Someone wanted to loop through the files in over 100 directories and find a list of their powerpoint files. This code will loop a specific directory and check if a file with a “pptx” extension exists in that directory. If it does, a message box will be displayed. Instead of the message box, the file’s […]
The purpose of this code is to tell you if you need to add a folder or not. ***You don’t need to create a new folder for some files if one exists already. This code is helpful if you have hundreds of folders to go through, otherwise if you just have a few, you can […]
So you need to end off a procedure by moving a file? This video shows you how to use the FileSystemObject and vba to move a file out of one directory into another? Well, this video shows you how to do it…
Option Compare Database
'DATABASE DESIGNED & CODED BY LOEBLCOM SERVICES 2013
Private Sub btnCreateTable_Click()
Dim strFileName As String
strFileName = "rptAddresses"
DoCmd.OutputTo acOutputReport, strFileName, acFormatPDF, CurrentProject.Path & "\" & strFileName & ".pdf"
'move file to sent directory
Dim objFSO As Object
'Dim objFSO As FileSystemObject
Dim strFromFile As String
Dim strToFile As String
strFromFile = CurrentProject.Path & "\" & filename & ".pdf"
'Your folder needs to be called "complete"
strToFile = CurrentProject.Path & "\complete\" & filename & ".pdf"
Set objFSO = CreateObject("Scripting.FileSystemObject")
'early binding - need library reference to "Microsoft Scripting Runtime"
'Set objFSO = New FileSystemObject
objFSO.MoveFile strFromFile, strToFile
MsgBox "The folder is moved from " & strFromFile & " to " & strToFile
Click here for the database and the code: vba-move-file.mdb