Results 1 to 10 of 10
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CreateReportControls

    Can anyone explain how to programatically change the order of controls created using the CreateReportControl function, in the same way you can in the designer using the Bring To Front / Send To Back menu options?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CreateReportControls

    Are you talking about changing their tab order? You can change that when you create the control. You can't programmatically change their creation order, only create them in the order you want. Could you explain what you're actually trying to do?
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CreateReportControls

    Charlotte,

    I think no, but the creation of controls on reports is new to me, so ...
    What I'm trying to do is reorder certain controls so they are on top of others, e.g. I have some graphic lines that I want to be on top of an image. I'm creating the report controls from data in a table, so I've added an order flag, but the how-to do in VBA the same as the menu operation "Bring To Front" is still bugging me.

    Cheers,
    Steve C.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CreateReportControls

    Have you tried sending the image to the back in design view and making the controls invisible
    untill needed

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CreateReportControls

    Jerry,

    the problem is how to do this using VBA - I can do it manually in the Report Design view, but what I'm trying to do is emulate this process in code. I can't find any reference to a property which sets the 'depth' of the control, I assume it's implicit to the order in the Controls collection, but I again can't find a way to re-order the collection.

  6. #6
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Tennessee
    Posts
    194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CreateReportControls

    instead of send to back or bring to front
    you can make the control visible or invisible
    text1.visible = true or
    text1.visible = false
    HTH

  7. #7
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: CreateReportControls

    Maybe I'm missing something here, but why would you WANT to do this from code? What kind of lines are you putting on top and under what conditions? Are we building some kind of wizard here?

    The only way I've found to do it is in design view using the DoCmd.RunCommand acCmdBringToFront or DoCmd.RunCommand acCmdSendToBack.

    Setting the visible property of the controls can be done in code in the OnFormat event of the section, but it doesn't seem like a logical thing to do. Perhaps if you explain what you're trying to accomplish with your report, we can figure out an answer.
    Charlotte

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CreateReportControls

    Charlotte,

    yeap it's starting to look like a wizard - I'd not planned it to be a fully comprehensive wizard, rather a simple tool for me to use in report generation, but other people have seen it, and .... it's growing

    Thanks for the tip on the acCmdBringToFront / acCmdSendToBack - I'm now driving the order of creation by a sequence flag in the data table, but it'll be useful to have a way to adjust after the order after creating a report

    Cheers,
    Steve C.

  9. #9
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CreateReportControls

    Jerry,

    not really suitable for all cases - I need to have both controls displaying, e.g. the positioning of lines and graphics is quite tight. The posting by Charlotte suggesting use of the DoCmd.RunCommand acCmdBringToFront looks to be a working solution.

  10. #10
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: CreateReportControls

    Oh forgot to ask
    - purely for interest, do you know where the 'sequence' is stored?
    I had a look at the control properties before and after a manual BringToFront / SendToBack but I couldn't see any change. Ditto I thought it might be the order in the collection, but again couldn't see anything, so I'm puzzled as to where Access is actually storing the information about the order of controls

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •