Hi All
The function below is intended to create a table called tblNewTable
which is a copy of tblProducts in another database, the name of the
database is held in strFileName.
The problem is that the function below refuses to treat strFileName as
a string
Function CopyDB(strFileN ame)
Dim x As String
x = DLookup("[DataPath]", "CurrentUse r")
Dim strSQL As String
Dim Db As Database
Set Db = CurrentDb
strSQL = "SELECT tblProducts.* INTO tblNewTable IN "
strSQL = strSQL & strFileName
strSQL = strSQL & "FROM tblProducts;"
Db.Execute strSQL, dbFailOnError
End Function
Thanks in advance
Patrick
Comment