Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Text box controls aren't populated in PrintPreview

    I have a report with Default View set to Print Preview, but the controls are all empty until the report is actually sent to the printer. Like, the OnFormat of the Detail section didn't fire until I Printed the report.



    Is there something obvious about a situation like this?

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    put all code in ON PRINT. Never found a use for OnFormat.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    For textboxes you have "Display When" set to Print Only ?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Made no difference.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Property setting for all TBs is "Always".

    Does it make any difference that the report is a sub-report on a form?

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Ya got me there. Methinks I mentioned that this would not be something I'd do unless I had to. I've played with it just to know that it can be done but that's it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Have you tried report view? That would make more sense in a subform as it wouldn't have "pages"

    I've used a report on a form quite often(Admittedly not for a while) and it always just worked?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Methinks I mentioned that this would not be something I'd do unless I had to.
    This is the first time I've ever had a sub-report in a form, though many times within a parent report. Anyway, changing the default view to "ReportView" as Minty suggested made no difference.

    There are several un-bound text boxes as well that don't find their values until they become available via Openargs in the OnOpen event code. I've had similar situations like that but never gave any issues in PrientPreview, even with multiple pages.

  9. #9
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I've just never had the inclination to look at a small version of a report that's been squashed into a subreport control on a form as opposed to viewing the whole thing. If I'm going to do that I might as well present that data as a subform. Subreport on a report is another matter.

    There is always the option to post the problem objects if you can't fix and need it, as you no doubt know.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  10. #10
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    With full discloser here, I'm adapting this old app to use Colin's method of hiding the Access Window, which is working fine with the other 9 reports associated with this app. With Colin's hidden Access Window method, reports are set as the container's ObjectSource in the OnOpen event where the container is the only control on the form.

    I've run the form itself several times in debug, but so far I've not detected any difference between this troublesome report and the other 9 that display properly in PrintReport view.

    I'll try adding an unbound text box to one of the other reports and setting it in the OnOpen event to see if that has any adverse affects.

    Did I mention that I hate reports? Not a big fan of un-bound text boxes either, but sometimes they're a necessary evil

    I commented out the code that sets the un-bound text boxes to see if at least the TBs bound to the RecordSource of the report would populate, but even those remained blank.

  11. #11
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    That sounds as if your report record source isn't being set correctly if everything is blank?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  12. #12
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    TBs bound to the RecordSource of the report would populate, but even those remained blank.
    I discounted the possibility of RecordSource gone afoul in that when the troublesome report is sent to a pdf file everything is as intended. However, I revisited my earlier investigation and found that of the 38 page report that the last page of preview was found to have its bound text boxes populated per the RecordSource.

    I'm at a loss as to what's wrong here. All I can think to do at this point is abandon my attempts to use Colin's hidden Access Window method, which I hate to do. Or, build a temporary table or query with goofy redundant fields so as to make all the un-bound text boxes bound, but that would be such a kludge it would be embarrassing.

  13. #13
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Look at your report record source in the report design. Open it in datasheet view from the report.
    There must be something wrong with it if it producing 37 blank pages.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  14. #14
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Hummmm, no "Datasheet view" option found, only "Report View" and "Report Preview", and then "Design View" of course.

  15. #15
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    Within the report design, click on the record source property and open it, then view that in datasheet view, that might give you a clue to the lack of data.

    The other thing is if you have any controls set to can grow = yes, temporarily set them all to no.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-22-2019, 12:25 PM
  2. Replies: 5
    Last Post: 07-05-2017, 02:36 PM
  3. Replies: 1
    Last Post: 12-29-2015, 05:15 AM
  4. Returning text from fields populated by combobox.
    By Goodtilitsgone10 in forum Access
    Replies: 2
    Last Post: 11-23-2015, 08:40 PM
  5. Replies: 3
    Last Post: 02-07-2013, 09:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums