I populated the list box using AllReports, etc. and I have two command buttons, one for Preview and one for Print on the form. How do I pick off the name of the report from the list box? I have tried using a variable to equal the highlighted column on the list box, but when I try to open the report all I get is the name of the column, not the content of the column selected. The following is the basic code I have been trying to use. What am I doing wrong?
Private Sub Command0_Click()
Dim rptReport As String
rptReport = " & listObjects.Column(2)"
DoCmd.OpenReport rptReport, acPreview
DoCmd.Close acForm, "ReportForm"
End Sub
Bob Peterson
Foster, RI
[email protected]