B
bymarce
I have a form called "WorkAssignments" on which my user can enter or look up
wokr assignments. I have a button that I want to send a filtered report
based on the initials of the person to whom the work was assigned and the
date on which it was assigned. I have a table called "Personel" that
contains first and last names, initials, and email addresses. I want to look
up the email addres in the "Personel" table based on the initials in the
unbound control "fAssignedTo" on the form. "fAssigned" to is used for
filtering the form. When I try to run this code it says "Invalid use of
Null" and highlights the Dlookup statement. How do I fix it?
Marcie
Dim SendTo As String
SendTo = DLookup("", "Personel", "[Initials] = ""Me.fAssignedTo""")
Dim strWhere As String
If Me.FilterOn Then
strWhere = Me.Filter
End If
Debug.Print strWhere
Dim MySubject As String, MyMessage As String
SendTo = Mail
MySubject = Me.MLO
MyMessage = "Please complete the following tests for " & Me.MLO & "."
DoCmd.SendObject acSendReport, "rptWorkAssignments", , SendTo, , ,
MySubject, MyMessage, False
wokr assignments. I have a button that I want to send a filtered report
based on the initials of the person to whom the work was assigned and the
date on which it was assigned. I have a table called "Personel" that
contains first and last names, initials, and email addresses. I want to look
up the email addres in the "Personel" table based on the initials in the
unbound control "fAssignedTo" on the form. "fAssigned" to is used for
filtering the form. When I try to run this code it says "Invalid use of
Null" and highlights the Dlookup statement. How do I fix it?
Marcie
Dim SendTo As String
SendTo = DLookup("", "Personel", "[Initials] = ""Me.fAssignedTo""")
Dim strWhere As String
If Me.FilterOn Then
strWhere = Me.Filter
End If
Debug.Print strWhere
Dim MySubject As String, MyMessage As String
SendTo = Mail
MySubject = Me.MLO
MyMessage = "Please complete the following tests for " & Me.MLO & "."
DoCmd.SendObject acSendReport, "rptWorkAssignments", , SendTo, , ,
MySubject, MyMessage, False