Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select individual reports from .Reports 1

Status
Not open for further replies.

nobeltlp

Programmer
Aug 22, 2005
6
US
Is it possible to select a saved report from
Containers.Reports.documents

Using the following I can list the entire contents
in a form list box, but there are only seven reports I want to list.



Private Sub Form_Load()
Dim MyRep As Document, Mydb As Database
Set Mydb = CurrentDb

Me!Replist.RowSource = ""

For Each MyRep In Mydb.Containers("Reports").Documents
Me!Replist.RowSource = Me!Replist.RowSource & MyRep.Name & ";"
Next MyRep


Me!Pgto.Enabled = False
Me!Pgfrom.Enabled = False
End Sub

I have tried veriations of If and For each with Like
"*.XXX", but I always recieve;"expression not supported with type object."
 
maybe create a query of the MSysObejcts Table as a rowsource for your listbox.

HTH,
fly

[blue]Typos, that don't affect the functionality of code, will not be corrected.[/blue]

Martin Serra Jr.
[blue]Shared Database_Systems and _Applications across all Business_Areas[/blue]
 
May I politely suggest that you not post the same question in multiple forums? See your other post for my response.

"Have a great day today and a better day tomorrow!
 
Something like this ?
For Each MyRep In Mydb.Containers("Reports").Documents
If MyRep.Name Like "*.XXX" Then
Me!Replist.RowSource = Me!Replist.RowSource & MyRep.Name & ";"
End If
Next MyRep

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top