> Ooops. Left off a closing parenthesis:
>
> Private Sub GenerateReport_Click()
> On Error GoTo Err_GenerateReport_Click
>
> If IsNull(Me!ReportList) Then
> MsgBox "You must select a report first."
> Else
> DoCmd.OpenReport Me!ReportList, acPreview
> End If
>
> Exit_GenerateReport_Click:
> Exit Sub
>
> Err_GenerateReport_Click:
> MsgBox Err.Description
> Resume Exit_GenerateReport_Click
>
> End Sub
>
>
> --
> Doug Steele, Microsoft Access MVP
>
http://I.Am/DougSteele> (no e-mails, please!)
>
>
> "Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_gmail.com> wrote in message
> news:eFSgZ2mSJHA.4084[ at ]TK2MSFTNGP04.phx.gbl...
> > Private Sub GenerateReport_Click()
> > On Error GoTo Err_GenerateReport_Click
> >
> > If IsNull(Me!ReportList Then
> > MsgBox "You must select a report first."
> > Else
> > DoCmd.OpenReport Me!ReportList, acPreview
> > End If
> >
> > Exit_GenerateReport_Click:
> > Exit Sub
> >
> > Err_GenerateReport_Click:
> > MsgBox Err.Description
> > Resume Exit_GenerateReport_Click
> >
> > End Sub
> >
> >
> > --
> > Doug Steele, Microsoft Access MVP
> >
http://I.Am/DougSteele> > (no e-mails, please!)
> >
> >
> > "Angelsnecropolis" <Angelsnecropolis[ at ]discussions.microsoft.com> wrote in
> > message news:B67E358E-594A-41B9-A7EA-6766C3572DF9[ at ]microsoft.com...
> >>I have a combo box named "ReportList" and a button named "GenerateReport"
> >>on
> >> a form. I'm trying to make the report selected in the combo box run when
> >> the
> >> one button is pressed as opposed to making several buttons for each
> >> report.
> >>
> >> I'm using the code below for a button for each report:
> >>
> >> Private Sub GenerateReport_Click()
> >> On Error GoTo Err_GenerateReport_Click
> >>
> >> Dim stDocName As String
> >>
> >> stDocName = "Takeovers - Kevin"
> >> DoCmd.OpenReport stDocName, acPreview
> >>
> >> Exit_GenerateReport_Click:
> >> Exit Sub
> >>
> >> Err_GenerateReport_Click:
> >> MsgBox Err.Description
> >> Resume Exit_GenerateReport_Click
> >>
> >> End Sub
> >>
> >>
> >> Thanks!
> >
> >
>
>
>