I have the code below which works if there is data in the field "Email" but crashes if the field is empty. How do i get it to ignore if the field is empty?
Dim db As Database
Dim rs As Recordset
Dim emailadd As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("sendexpiredproposals")
emailadd = rs.Fields("Email")
DoCmd.SendObject acReport, "ExpiredProposals", "PDFFormat(*.pdf)", _
emailadd, "", "", "Expired Proposal - " & Date, "This proposal has expired", _
True, ""
Dim db As Database
Dim rs As Recordset
Dim emailadd As String
Set db = CurrentDb()
Set rs = db.OpenRecordset("sendexpiredproposals")
emailadd = rs.Fields("Email")
DoCmd.SendObject acReport, "ExpiredProposals", "PDFFormat(*.pdf)", _
emailadd, "", "", "Expired Proposal - " & Date, "This proposal has expired", _
True, ""