Listing C
Command_Click event
Private Sub cmdSendReport_Click()
  Dim strReport As String
  strReport = Forms!frmSendSnapshotReport!lstReports.Value
  On Error GoTo errHandler
  DoCmd.SendObject acSendReport, strReport, _
      "SnapshotFormat(*.snp)", , , , , , True
  Exit Sub
 
errHandler:
  If Err.Number = 2580 Then
    MsgBox "The data source for " & strReport & _
        " is missing", vbOKOnly, "Error"
  Else
    MsgBox Err.Number & " " & Err.Description, _
        vbOKOnly, "Error"
  End If
End Sub