How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Tim Your Own Question
Tim, Sr. Engineer
Category: Programming
Satisfied Customers: 1075
Experience:  Sr. Systems and Network Engineer
Type Your Programming Question Here...
Tim is online now
A new question is answered every 9 seconds

My question is not about Microsoft office it is a Visual

This answer was rated:

my question is not about Microsoft office it is a Visual Basic Programming question...….I need to back up an Access 2016 database this would occur from button click event in a Visual Basic program. Not sure how to go about this.

Hello, I'm Tim and have over 17 years of experience with eBay, Google, and the Department of Defense. Please tell me more about your problem, the more detail, the better.


You mean you want to automate it?

You can go to File, select Backup, and then save the back up file. You can automate that in a batch script or using AutoHotkey.

Tim and 4 other Programming Specialists are ready to help you
Customer: replied 11 days ago.
I want to be able to click a button in the program I am writing and have it backup the database used by the program and number the backups consecutively and save them incase of a problem

Batch Script.

OK, so I can connect remotely (only on windows based machines), please click the link below, hit yes and download and open the software and hit run.

Customer: replied 11 days ago.
it doesn't seem to work

hmm, OK let me reset it.

what programing language are you writing in by the way?

You can include this as a subscript the below:


Public Sub backupBackend() Dim TestFile As String Dim strReplFile As String Dim copyFromLocation As String Dim copyToLocation As String copyFromLocation = "S:\Trust 2 Analysis\Data" ' set the file name and location of the file to copy copyFromLocation = copyFromLocation & "\trust2_be.accdb" 'set the location/name of the file that will be written copyToLocation = "S:\Trust 2 Analysis\Data\Backups\trust2_be " & Format(Now(), "dd-mm-yy hh-mm-ss") & ".accdb" ' set the file name of the batch file to create TestFile = CurrentProject.Path & "\BackupDbBE.cmd" ' create the batch file Open TestFile For Output As #1 Print #1, "Echo Off" Print #1, "ECHO Backing up database" Print #1, "" Print #1, "ECHO Copying file to backup folder" Print #1, "Copy /Y """ & copyFromLocation & """ """ & copyToLocation & """" Print #1, "" Print #1, "DEL " & """%~f0""" Close #1 ' run the batch file Shell TestFile End Sub

Customer: replied 11 days ago.
I am using Visual Basic 2017

".I need to back up an Access 2016 "


It should be similar. What are you coding in?

Customer: replied 11 days ago.
visual Basic using Visual studio 2017

Same principle.