Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This is a very good site. Please keep it running. Thanks and wishing a great health and success for the site and its owners..."

Geography

Where in the world do Tek-Tips members come from?
JamesHardiman (MIS)
29 Aug 03 5:29
Yesterday I got help with iterating through the Reports collection (whether or not closed or open)... for which thanks!

Now I'm trying to iterate through the properties of a report, but can't get my head round the object model.

This is what I have:


Private Sub cmdDoit_Click()
Dim obj As AccessObject
Dim dbs As Object
Dim prop As AccessObjectProperty
Dim rs As ADODB.Recordset
   ' Open connection and recordset...
   ' Goes here
    Set dbs = Application.CurrentProject
    ' Search for open AccessObject objects in AllReports collection.
    For Each obj In dbs.AllReports
        DoCmd.OpenReport obj.Name, acViewDesign
        For Each prop In obj.AccessObjectProperties
            rs.AddNew
            rs!ObjectName = obj.Name
            rs!PropertyName = prop.Name
            rs!NewValue = Reports(obj.Name).Value
            DoCmd.Close acReport, obj.Name
            rs.Update
        Next prop
    Next obj
    rs.Close
End Sub

... but that doesn't come close.  For a start the For Each Prop doesn't work: there are usually no properties, and if I do a watch on it, the properties I see aren't those that I want.  If I type in Reports(obj.name). I get that nice VB drop-down menu of all the properties of a report.  But I want to get at that in run time, not design time.

My brain's beginning to fuse again: can anyone help?

Thanks

JamesH@Sunsail.com

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close