Results 1 to 9 of 9
  1. #1
    MarkAgain is offline Novice
    Windows 7 32bit Office 365
    Join Date
    May 2020
    Posts
    4

    Print Preview missing unbound data

    Good afternoon,

    I have a Access report that works as expected when opening it with: DoCmd.OpenReport "PrintReportFront", acViewReport ...

    When I open the same report with: DoCmd.OpenReport "PrintReportFront", acPreview ...



    the unbound textbox that I fill in with VBA are blank. I'm using the VBA to convert a number saved in a bound textbox into the text version of that number (10 becomes Ten).

    I have two questions.

    1. Is this normal behavior?
    2. Is there a way to have the unbound textbox filled in with VBA when opening the report in Print Preview?

    Thank you, Mark

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    The report data comes from a query,which comes from a table.
    unbound is not in a table.
    but in the query ,you can load the unbound box using the full path name:
    forms!fMyForm!txtBox1

    sometimes it wont show, so under this path,choose Expression,instead of GroupBy.

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Also, the event you used can make a difference. There are events that fire in preview but not in report, and vice versa.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    MarkAgain is offline Novice
    Windows 7 32bit Office 365
    Join Date
    May 2020
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    Also, the event you used can make a difference. There are events that fire in preview but not in report, and vice versa.
    Thank you for the reply.

    I'm sorry. I'm confused. Im not using a query. The data for the unbound text box is entered using VBA from a table during the on load event. The VBA takes the value in a bound text box (shows on the report in both viewreport and preview) and converts the value into a spelled out number. This number (say "Ten") is entered into the unbound textbox. I tried using the on current as well with no difference. Sorry I don't have a better grasp on this.

    Thank you, Mark

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    I'm confused because I didn't mention queries. I use the format event of the appropriate section for preview, the paint event for report view.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    MarkAgain is offline Novice
    Windows 7 32bit Office 365
    Join Date
    May 2020
    Posts
    4
    Sorry about that. The query was in response to the post by:
    ranman256

  7. #7
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Did you try changing the event(s) used? Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    MarkAgain is offline Novice
    Windows 7 32bit Office 365
    Join Date
    May 2020
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    Did you try changing the event(s) used? Can you attach the db here?
    Thank you for the reply.

    I tried on load and on current events with no changes. I can't upload or even take the DB or code out of the office.

    Thank you, Mark

  9. #9
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Quote Originally Posted by MarkAgain View Post
    I tried on load and on current events with no changes. I can't upload or even take the DB or code out of the office.
    Yes, and I suggested: "I use the format event of the appropriate section for preview, the paint event for report view."
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 12-23-2018, 05:23 PM
  2. Replies: 1
    Last Post: 12-13-2018, 01:06 PM
  3. Data changes from Report View to Print Preview
    By AccessPadawan86 in forum Reports
    Replies: 9
    Last Post: 07-24-2017, 08:49 AM
  4. Replies: 5
    Last Post: 07-29-2014, 01:05 PM
  5. Replies: 1
    Last Post: 01-23-2011, 09:21 AM

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