My code is as follows, but there is an error in the code, Please help me to resolve the issue.
Private Sub Command33_Click()
Dim Dbs As DAO.Database
Dim Rst As DAO.Recordset
Set Dbs = CurrentDb
Set Rst = Dbs.OpenRecordset("Select * from [ACTIVE SERVICE ORDERS EXP EMAIL] ")
Rst.MoveFirst
Do While Not Rst.EOF
Report_LETTEREMAIL.LETTERSUB.Report.RecordSource = "Select * ACTSEVEMAILQ WHERE SID=" & Rst!SID
DoCmd.OpenReport "LETTEREMAIL", acViewPreview, , , acWindowNormal
Rst.MoveNext
Loop
End Sub