Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Portland, Maine, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing a datasheet that is a subform (XP/SP2)

    I'm trying to come up with a way to print a datasheet that is a subform. Short of closing the main form and opening the subform by itself then applying the filter that was in the subform...printing and then opening the main form again....is there an easier way?

    Thanks,
    Don

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing a datasheet that is a subform (XP/SP2)

    I would create a report based on the same record source as the subform; you can open it with the appropriate where-condition from the main form:

    DoCmd.OpenReport ReportName:="rptMyReport", View:=acViewPreview, WhereCondition:="ID=" & Me.ID

    You'll have to substitute the name of your report, and modify the WhereCondition for your situation. If you want to send the report to the printer directly, without viewing it, use acViewNormal instead of acViewPreview.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Portland, Maine, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a datasheet that is a subform (XP/SP2)

    Your too quick Hans! I have thought of creating a report but the problem is that the datasheets columns can be hidden/shown by the user...up to 27 different columns. So was thinking that creating a report was going to be way too much trouble...you know hiding controls and showing controls. Any other thoughts?

    Thanks,
    Don

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing a datasheet that is a subform (XP/SP2)

    How are you going to print up to 27 columns? Get a printer that outputs posters? <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Portland, Maine, USA
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing a datasheet that is a subform (XP/SP2)

    There must be some kind of printer that could do it!! Ha...kidding. Actually the users are obviously not going to print all 27 columns, if they do they are WAY out of luck. I'm just saying that check which columns are actually displayed and then show/hide in the report on the possible combinations would be hell...wouldn't it? There has to be an easy way to just print a subform like printing the main form, but then again this is Access and Microsoft is involved!

    Thanks,
    Don

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Printing a datasheet that is a subform (XP/SP2)

    I don't think Microsoft is to blame if you insist on using Access in ways it wasn't intended to be used.

    Printing the subform separately might be your best bet. The alternative would be to use a generic unbound report, and set its record source and the control source of the text boxes in code in the On Open event.

Posting Permissions

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