Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628

    Unanswered: Need help!!! (Forms and reports working together)

    Hi all,

    I need some help with this problem. What i would like to do is to display a report on a form in preview mode, but only when the user clicks on the "Show Report" option.

    Im not sure if this is possible, but if so, i would really appreciate any help.

    Thanks.

  2. #2
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    I for myself don´t use much the report functionalities of msaccess, for several reasons, i use PrintPreview ActiveX, which can be downloaded at www.mandix.com, to day an update released (vers. 5.20), I suggest to have a look at it.

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by cruickshanks
    Hi all,

    I need some help with this problem. What i would like to do is to display a report on a form in preview mode, but only when the user clicks on the "Show Report" option.

    Im not sure if this is possible, but if so, i would really appreciate any help.

    Thanks.
    ... And " DoCmd.OpenReport "Some Report Name Here", acViewPreview" won't do the job???
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    that will do of course :-)))

  5. #5
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    that works, but it opens the report in another window. What i want to do is to get it to open in a sub form or something, but i don't know how to do that.

  6. #6
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    have a look at the 'Output To' method.

    output it to a txt file, and read it back to textbox.

    it takes some programming I think, but it will do hopefully.

  7. #7
    Join Date
    Sep 2004
    Location
    Reston, VA
    Posts
    86
    The only way I know of doing this is to show the report in an Unbound Object Frame (should be on the controls toolbar). When you place the control on your form, it will ask you what kind of object type you want to display in the control. Of course, you can't add the report from inside your database...when they click on the "Show Report" option, you'll have to use code in the Click event to run and save it as a snapshot, bind the snapshot to the control, then make the control visible so they can see it.

    If it's a report that's going to change a lot, though, it wouldn't make sense to keep running and saving it over and over...so it may be better just to use the table/query that underlies the report and add some textboxes/labels, bind them to the data and do some formatting tricks with the controls to make it "look" like a report.

  8. #8
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    Thanks for that.

    The way i ended up doing it, because it is a completely custom report was to simply copy the report contents in design mode and paste it onto a new form. Then i saved the form using the same name as the report with _subform after it.

    I then used the subform control and binded it to the _subform form, and it works that way.

    This works due to the user selecting the "View Report" button, then after it appears, there are three options with it also (View All Reports, Print and Close). The Close simply re-toggles the visible options to false after the focus of the subform has been moved elsewhere (i used a "dud" command button for this purpose).

    The Print button refers to the original report that populated the subform, so it all ended up working out. Here's a screen shot of it to hopefully help explain what i did (It's still under construction, so there are some sections that look strange).
    Attached Thumbnails Attached Thumbnails main_menu.jpg  

Posting Permissions

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