reports in a dropdown?

report descriptions

i have a drop down list with reports but i cant see the reports desription
where can i find it?
 
You folks are making this painful. All you need to do is:

1. Put a combo-box on your form. Name it cboReports.
2. In the cboReports Properties, click on the Data Tab.
3. Set the Row Source Type to Table/Query
4. Copy/Paste Pat Hartman's earlier suggested code and
place it in the Row Source.
5. Ensure Bound Column is set to 1.
6. Click on the Event Tab. Create an event procedure for
the After Update event [not the On Click]
7. Place this one line in it:
docmd.OpenReport Me!cboReport, acViewPreview

The procedure in its entirety will look like:

Private Sub cboReport_AfterUpdate()
docmd.OpenReport Me!cboReport, acViewPreview
End Sub

8. Return to form view and select a report from the combo
Box. Upon selecting the report name, the report will
open in preview mode.
 
And if you don't want to use the Hidden System tables, use the AllReports collection as Pat also suggested.
Code:
Private Sub Form_Open(Cancel As Integer)
    Dim obj As AccessObject, dbs As Object
    Dim strReports As String
    
    Set dbs = Application.CurrentProject
    For Each obj In dbs.AllReports
        If strReports <> "" Then
            strReports = strReports & ";" & obj.Name
        Else
            strReports = obj.Name
        End If
    Next obj
    
    Me.cboReports.RowSource = strReports
    Me.cboReports = me.cboReports.column(0,0)

End Sub
Then use the afterupdate event procedure that raskew provided.

Dave
 

Users who are viewing this thread

Back
Top Bottom