is it something as banal as a parenthesis error?
tought to diagnose, but here's a go at a count ('scuse the ugly syntax)
strSQL = "SELECT TOP " & samples & " tblSampleRuns.RunDate, tblSiteVisits.SiteID, tblSampleData.ParameterID, tblSampleData.Value, tblSampleData.PracticalDetectionLimit, IIf...