Hey guys. Would someone be able to please point me in the right direction? Here's my sql:
Code:
strSql = "INSERT INTO t_EmployeeData ( PayrollID )" & _
" SELECT t_employees AS t_employees.ID " & _
" FROM t_employees LEFT JOIN t_EmployeeData ON t_employees.ID = t_EmployeeData.PayrollID " & _
" WHERE (((t_EmployeeData.PayrollID) Is Null));"
[code]
The table in my remote database is called t_employees. I want to update my local table called t_EmployeeData with any missing employees from the remote table. I have successfully opened the remote database but I can't seem to get the correct syntax for my SQL because the t_employees table is in the remote database and not the local one.
Here's the code I've used to open the remote database:
[code]
' Open the database while supplying the password
Set db = DAO.OpenDatabase(exDbase, False, False, ";pwd=" & dbPassword)
Set tbDef = db.TableDefs("t_employees")