I automated a copy-paste procedure that runs upon clicking a button, see code underneeth.
All of this works fine, as long as I have the data in the folder "D:\FolderA\". However, since this database is going to be used by others as well I have created the table tbl_path with two fields (1 record): 'source' and 'destination'. These cells contain the respetive paths to the source and destination folders. How do I link strSource and strDest to these values?
Code:
Private Sub Command122_Click()
Dim rs As dao.Recordset, strSource, strDest
strSource = "D:\FolderA\"
strDest = "D:\FolderB\"
Set rs = CurrentDb.OpenRecordset("select * from tbl_archief where nieuw=true")
If rs.EOF Then Exit Sub
Do Until rs.EOF
FileCopy strSource & rs![file], strDest & rs![file]
rs.MoveNext
Loop
End Sub
All of this works fine, as long as I have the data in the folder "D:\FolderA\". However, since this database is going to be used by others as well I have created the table tbl_path with two fields (1 record): 'source' and 'destination'. These cells contain the respetive paths to the source and destination folders. How do I link strSource and strDest to these values?