Ended up with this, with copy-paste from here & there ( It appears to be working ).
Code:
Function CopyDocs()
Dim RequiredDocs As DAO.Database
Dim rs As DAO.Recordset
Dim strsql As String
Dim GetDoc As String
Dim GetDocFull As String
Dim SourceA As String
Dim Dest As String
Set RequiredDocs = CurrentDb
SourceA = "C:\myDesktop\fldrData\"
Dest = "C:\myDesktop\fldrMissingData\"
strsql = "SELECT * FROM tblRequiredDocs"
Set rs = CurrentDb.OpenRecordset(strsql)
'Check to see if the recordset actually contains rows
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst 'Unnecessary in this case, but still a good habit
Do Until rs.EOF = True
'Perform an edit
rs.Edit
GetDoc = rs("txtWantedDoc")
GetDocFull = GetDoc & ".doc"
FileCopy SourceA & GetDocFull, Dest & GetDocFull
'Move to the next record. Don't ever forget to do this.
rs.MoveNext
Loop
Else
MsgBox "There are no records in the recordset."
End If
MsgBox "Finished looping through records."
rs.Close 'Close the recordset
Set rs = Nothing 'Clean up
End Function
Kindly let me know, if you find some pitfalls in it.
Thanks