Angie said:
I think that is my issue. Could you post a sample of code for me? How do I
dim recordset and how do I refer to each record as it loops through?
Here's the general idea:
Function EmailBody() As String
Dim RS As DAO.Recordset
Dim tmpEM As String
Dim sSQL As String
sSQL = "SELECT blah blah blah;"
Set RS = DBEngine(0)(0).OpenRecordset(sSQL)
RS.MoveFirst
Do While Not RS.EOF
' Here we start looping through the records
' Reference the fields on each record with Fields(n) below.
' Create a loop across the fields if you have a lot of them (^:
tmpEM = tmpEM & Nz(RS.Fields(0).Value, "") & ";"
' Debug.Print tmpEM ' uncomment this line and step through code to see
what's going on here
RS.MoveNext
Loop
EmailBody = tmpEM
Set RS = Nothing
End Function
Hope this helps!