G
Guest
I have the following codes. When I run it. it shows Error 3061, too few
parameters, expect 1. on Set rs = db.OpenRecordset(strSQL)
Please help out!
Dim db As DAO.Database, rs As DAO.Recordset
Dim strSQL As String
strSQL = "Select EMAIL From AGENT where COUNTY =" &
[Forms]![frmReport]![listCounty]
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
strAccount = rs!
Do While Not rs.EOF
rs.AddNew
strAccount = strAccount & ",rs![EMAIL]"
rs.Update
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Debug.Print strAccount
parameters, expect 1. on Set rs = db.OpenRecordset(strSQL)
Please help out!
Dim db As DAO.Database, rs As DAO.Recordset
Dim strSQL As String
strSQL = "Select EMAIL From AGENT where COUNTY =" &
[Forms]![frmReport]![listCounty]
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
strAccount = rs!
Do While Not rs.EOF
rs.AddNew
strAccount = strAccount & ",rs![EMAIL]"
rs.Update
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
Debug.Print strAccount