I am successfully using this:
to copy a table from Access to Excel (Office 2016).Sub ReadPaidJobs() With CreateObject("ADODB.Recordset") .Open "SELECT * FROM PaidJobs", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Sett.Cells(38, 2) & "KKDB.accdb;" DBPJ.Range("A2").CopyFromRecordset .DataSource End With End Sub
However, if I try to use this:
to read just the job numbers I don't get anything, no errors or data! All I've changed is the field name instead of the * and the destination.Sub ReadPJobNo() With CreateObject("ADODB.Recordset") .Open "SELECT JobNo FROM PaidJobs", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Sett.Cells(38, 2) & "KKDB.accdb;" DBSum.Range("A2").CopyFromRecordset .DataSource End With End Sub
Where am I going wrong?
Best regards
Paul Ked




Reply With Quote