Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending email in Access 97

Status
Not open for further replies.
Oct 12, 2005
204
GB
Hi,

I realise 97 is way out of date, but I've been asked to have a look at a db that 'used ' to send emails to users, but has now stopped. I'm not a access expert, so was wondering if anyone could help, below is the code that is behind the send email button. when the button is pressed it gives an Invalid use of Null error.

Code:
Private Sub Command285_Click()
Dim Mail As String
Dim Count As Integer
Dim RetValue As Integer

RetValue = MsgBox("WARNING ! - This will send an email to all employees with Corrective Actions ", vbOKCancel)
If RetValue = vbCancel Then
Exit Sub
DoCmd.SetWarnings (0)
Else
   For Count = 0 To Combo272.ListCount - 1
     Combo272.Value = Combo272.ItemData(Count)

     Mail = Combo272.Column(1)
     DoCmd.SendObject acSendReport, "rptCorrectiveActionsList", acFormatRTF, Mail, , , "Corrective Actions report", "Please find attached a copy of your Corrective Actions Report. Can you please try to avoid any of these actions from becoming Overdue.Can you please let ... know when any action has been completed (QAdmin@xxxxxxx.co.uk)  Thanks"
      Next
End If
DoCmd.SetWarnings (-1)
    
End Sub


If anyone can see why we are getting this error, or recommend the best way to get this working I would appreciate it.

Regards,

Mick.


 
Sorry forgot to mention the debugger highlights the following line

Code:
Mail = Combo272.Column(1)

Regards,

Mick.
 
You might be interested in looking for a report email distribution solution which does not involve any coding at all and will not break when new versions of Access and Windows are released. Such software is DocumentBurster - and it can distribute PDF reports generated with Microsoft Access.

 
Thanks for the reply, but I tracked it down to the combo box not populating the email address, just the name, so changed that and now it works again.

Mick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top