I have it coded here:
strSQL = "SELECT " & tblName & ".Page, " & tblName & ".Date, " & tblName & ".Subject, " & tblName & ".Company, " & tblName & ".People " & _
"FROM " & tblName
The thing is, I want the tblName to be dynamic. Above that code is this:
tblName = "tbl" & Me!cmbSource
Where 'cmbSource' is the table selected from the combo box.
ie: If I selected "Pears" from the combo box. The SQL statement should read:
SELECT tblPear.Page, tblPear.Date, tblPear.Subject, tblPear.Company, tblPear.People
FROM tblPear
However, I get a syntax error. Did I miss something obvious?
strSQL = "SELECT " & tblName & ".Page, " & tblName & ".Date, " & tblName & ".Subject, " & tblName & ".Company, " & tblName & ".People " & _
"FROM " & tblName
The thing is, I want the tblName to be dynamic. Above that code is this:
tblName = "tbl" & Me!cmbSource
Where 'cmbSource' is the table selected from the combo box.
ie: If I selected "Pears" from the combo box. The SQL statement should read:
SELECT tblPear.Page, tblPear.Date, tblPear.Subject, tblPear.Company, tblPear.People
FROM tblPear
However, I get a syntax error. Did I miss something obvious?