Not your usual make a backup question here.
Currently I have the following code to perform backups.
CODE
FileCopy "N:\MyDatabase_be.mdb", "N:\Backups\MyDatabase_be_Backup.mdb"
This is the basic code, but it has been expanded to allow up to 5 backups to be made and works fine.
My problem now is that my boss wants to be able to create or copy a backup on a USB stick. This wouldn't be a problem normally as I could just insert the address of the USB drive destination and "FileCopy" over to it. The problem is that the drive letter for the USB stick changes depending on what else he has plugged it/turned on at the time.
I've used some browse coding I found on UtterAccess a while back to determine the file to be copied (basBrowse by Ken Getz) I've included the code from the form, but not from the module itself.
CODE
Dim strFilter As String, strInputFileName As String, strFil As String, strFol As String
strFilter = ahtAddFilterItem(strFilter, "Access Databases (*.mdb)", "*.mdb")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave(Filter:=strFilter, OpenFile:=False, InitialDir:="N:\", _
DialogTitle:=" Browse for Document...", _
Flags:=ahtOFN_HIDEREADONLY)
If Not strInputFileName = "" Then
Me![Source] = strInputFileName
DoCmd.Save
End If
strFilter = ahtAddFilterItem(strFilter, "Access Databases (*.mdb)", "*.mdb")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strInputFileName = ahtCommonFileOpenSave(Filter:=strFilter, OpenFile:=False, InitialDir:="N:\", _
DialogTitle:=" Browse for Document...", _
Flags:=ahtOFN_HIDEREADONLY)
If Not strInputFileName = "" Then
Me![Source] = strInputFileName
DoCmd.Save
End If
this works great to locate a file, but is there any way I can alter it to allow me to either identify a folder, or actually save the "source" file to that location?