Is there an easier way to do this? I have a list box and a button that will work of the selected box but there are a ton of entries....
If Me.ListContact = "Alphabetical Customer Listing" Then
DoCmd.OutputTo acOutputReport, "rptAlphabeticalContactListing", acFormatSNP, , yes
ElseIf Me.ListContact = "Calls NOT Made or Pending" Then
DoCmd.OutputTo acOutputReport, "rptContactsNOTcalledorpending", acFormatSNP, , yes
ElseIf Me.ListContact = "Customers by Selected Type" Then
DoCmd.OutputTo acOutputReport, "rptContactListingbySelectedType", acFormatSNP, , yes
ElseIf Me.ListContact = "Daily Calls Logged" Then
DoCmd.OutputTo acOutputReport, "rptDailyDateSpecificCallReport", acFormatSNP, , yes
ElseIf Me.ListContact = "Upcoming Call Listing" Then
DoCmd.OutputTo acOutputReport, "rptUpcomingCallSummary", acFormatSNP, , yes
ElseIf Me.ListContact = "Weekly Calls Logged" Then
DoCmd.OutputTo acOutputReport, "rptWeeklyCallListing", acFormatSNP, , yes
End If
MsgBox "Export Completed Successful", vbOKOnly
SnapshotError_Exit:
Exit Sub
Err_SnapshotError:
strMsg = " You have either Canceled this Action or have yet to select a Report."
MsgBox strMsg, vbCritical
Resume SnapshotError_Exit
If Me.ListContact = "Alphabetical Customer Listing" Then
DoCmd.OutputTo acOutputReport, "rptAlphabeticalContactListing", acFormatSNP, , yes
ElseIf Me.ListContact = "Calls NOT Made or Pending" Then
DoCmd.OutputTo acOutputReport, "rptContactsNOTcalledorpending", acFormatSNP, , yes
ElseIf Me.ListContact = "Customers by Selected Type" Then
DoCmd.OutputTo acOutputReport, "rptContactListingbySelectedType", acFormatSNP, , yes
ElseIf Me.ListContact = "Daily Calls Logged" Then
DoCmd.OutputTo acOutputReport, "rptDailyDateSpecificCallReport", acFormatSNP, , yes
ElseIf Me.ListContact = "Upcoming Call Listing" Then
DoCmd.OutputTo acOutputReport, "rptUpcomingCallSummary", acFormatSNP, , yes
ElseIf Me.ListContact = "Weekly Calls Logged" Then
DoCmd.OutputTo acOutputReport, "rptWeeklyCallListing", acFormatSNP, , yes
End If
MsgBox "Export Completed Successful", vbOKOnly
SnapshotError_Exit:
Exit Sub
Err_SnapshotError:
strMsg = " You have either Canceled this Action or have yet to select a Report."
MsgBox strMsg, vbCritical
Resume SnapshotError_Exit