Hi guys. I have a database that pulls information from a query puts it in a form and then emails it to whoever needs it. everything works fine on it except i cannot get it to work with a continuous form. it only emails the top row. I cant figure out what to do to make it pull all the records. Any idea what i need to do? I think i might need to do some type of loop but not sure and not sure how. I am pretty new to this still so if anyone could help that would be great.
Code:
Private Sub Command4_Click()
On Error GoTo Err_SendInfo_Click
Dim varTo As Variant
Dim varCC As Variant
Dim stSubject As String
Dim stItem As String
Dim stQty As String
varTo = DLookup("[Email]", "tblEmail")
varCC = DLookup("[CC]", "tblEmail")
stSubject = "Items to fix"
stItem = Me.item
stQty = Me.qty
stText = "*****DO NOT EDIT ANYTHING*****." & Chr$(13) & Chr$(13) & _
"Item: " & stItem & Chr$(13) & _
"Qty: " & stQty
DoCmd.SendObject , , acFormatTXT, varTo, varCC, , stSubject, stText, -1
On Error GoTo Err_Execute
CurrentDb.Execute strSQL, dbFailOnError
On Error GoTo 0
Exit Sub
Err_Execute:
Resume Next
Exit_SendInfo_Click:
Exit Sub
Err_SendInfo_Click:
MsgBox Err.Description
Resume Exit_SendInfo_Click
End Sub