R
Reg
I am getting this error:
Runtime Error 3061
Too few parameters. Expected 1
at the line:
Set rstSector = db.OpenRecordset(strSQL, dbOpenDynaset)
When I run this code :
thisSector = lstSectors.Column(1)
Dim db As Database, rstSector As Recordset, strSQL As String
strSQL = "SELECT Reps.Email
FROM (Reps INNER JOIN Companies
ON Reps.CompanyID = Companies.CompanyID)
INNER JOIN Sector ON Companies.SectorID = Sector.SectorID
WHERE (Sector.SectorName)=thisSector"
Set db = CurrentDb()
Set rstSector = db.OpenRecordset(strSQL, dbOpenDynaset)
I would be grateful if someone could tell me where I am going wrong.
Thanks
Reg
Runtime Error 3061
Too few parameters. Expected 1
at the line:
Set rstSector = db.OpenRecordset(strSQL, dbOpenDynaset)
When I run this code :
thisSector = lstSectors.Column(1)
Dim db As Database, rstSector As Recordset, strSQL As String
strSQL = "SELECT Reps.Email
FROM (Reps INNER JOIN Companies
ON Reps.CompanyID = Companies.CompanyID)
INNER JOIN Sector ON Companies.SectorID = Sector.SectorID
WHERE (Sector.SectorName)=thisSector"
Set db = CurrentDb()
Set rstSector = db.OpenRecordset(strSQL, dbOpenDynaset)
I would be grateful if someone could tell me where I am going wrong.
Thanks
Reg