I have it working now however
correction: it saves the last email and emails it to the next if they are blank (retained dim I guess)
I can't figure out why it doesn't change with the next record...?
code below:
Code:
rs.MoveFirst
Do Until rs.EOF
If Me.Frame63 = 1 Then
If Not IsNothing(rs![1ContactEmail]) Then
emailofsc = rs![1ContactEmail]
End If
ElseIf Me.Frame63 = 2 Then
If Not IsNothing(rs![6EnglishEmail]) Then
emailofsc = rs![6EnglishEmail]
End If
ElseIf Me.Frame63 = 3 Then
If Not IsNothing(rs![2LibrarianEmail]) Then
emailofsc = rs![2LibrarianEmail]
End If
ElseIf Me.Frame63 = 4 Then
If Not IsNothing(rs![4MusicEmail]) Then
emailofsc = rs![4MusicEmail]
End If
ElseIf Me.Frame63 = 5 Then
If Not IsNothing(rs![3DramaEmail]) Then
emailofsc = rs![3DramaEmail]
End If
ElseIf Me.Frame63 = 6 Then
If Not IsNothing(rs![5WelfareEmail]) Then
emailofsc = rs![5WelfareEmail]
End If
ElseIf Me.Frame63 = 7 Then
If Not IsNothing(rs![SchoolEmail]) Then
emailofsc = rs!SchoolEmail
End If
End If
DoCmd.SendObject , , , "email@email.com.au", , , emsubject & " " & emailofsc, messagebody, no
rs.MoveNext
Loop