Results 1 to 6 of 6
  1. #1
    PeakH is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    143

    Can I set Popup = True temporarily


    I'm trying to make a preview button on an inventory form so that if a user is looking at an item of inventory they can see what invoices included that item, click on the invoice number to see the invoice report in print preview and then print or close out.
    I have the database set up so that there are no close buttons on anything that is not a popup (I use added buttons to navigate). The Invoice report is usually viewed in report view with navigation buttons at the top.
    So I want to temporarily set the report's popup setting to true but am having a hard time figuring out how to do this.
    The code I've tried:
    Code:
    Private Sub ConfNum_Click()    If [IsSample] = True Then
                Reports!rptOrderConfSample.Report.PopUp = True
                DoCmd.OpenReport "rptOrderConfSample", acViewPreview, , "[ConfNum] =" & [Forms]![frmLotDetails]![rptGramsPacksAndPriceSoldOfLot].Report!ConfNum
        Else
                Reports!rptOrderConf.Report.PopUp = True
                DoCmd.OpenReport "rptOrderConf", acViewPreview, , "[ConfNum] =" & [Forms]![frmLotDetails]![rptGramsPacksAndPriceSoldOfLot].Report!ConfNum
                   
        End If
    End Sub
    This way I get an error that says : 'rptOrderConfSample' is misspelled or refers to a report that isn't open or doesn't exist.

    Well the report isn't open yet, so that makes sense.
    But, if I switch the code to open the report first it tells me that I need to open the report in design view in order to change this. Users won't be able to do that...

    Any thoughts or insight?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why does report need to be a popup to begin with? I've never opened report as popup. But I always set db for Overlapping Windows instead of Tabbed Documents. What is your setup?

    Code would have to open report in Design View, edit property, save, open again in Preview.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    It isn't possible to change the popup property unless a report (or a form) is in design view - it can't be toggled on / off whilst in use
    Whilst VBA will allow you to enter code like Me.Popup =True in the Report_Load or Open event, it will error when in use as you stated

    I do occasionally set reports to be popup = true but can't see any reason for wanting to switch that on temporarily.
    However I also don't use report view so I never put buttons on a report
    Instead I just open reports in print preview mode
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Not tested, but perhaps try the other way round

    Set the report modal and popup properties to true and save.

    Then try docmd.openreport opening and setting the window mode parameter to acnormal. Or perhaps some code in the open event to turn off if not required (it works in forms but by the sound of it will fail on reports)

    Another option perhaps is to set the report as a subreport to a form and have buttons on the form to control printing

  5. #5
    PeakH is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    143
    I have it set to tabbed documents without the tab showing. If it's opened in print preview without being popup there's no way to close it without closing the whole database. Normally the report is open in report view so the navigation buttons show at the top. The navigation buttons are designed to go to and from other forms in the database (frmOrderList, frmMainMenu, frmEditOrder) but are not designed to go to a specific item of inventory on the order. So if a user is looking at an item of inventory and opens an associated order, I'd like it to be popup preview so that they can view, print if needed, and then close out of it without navigating away from inventory.

    I have thought of making the report a subreport on a form, but I haven't really figured out how to do so without needing to scroll when there are lots of records. I always set the Can Grow property to "Yes" thinking that if there are more records, the subreport will grow on the form to fit them all, but I guess that's not how it works.

    As the database gets more complicated, I'm beginning to think that maybe I just need to rethink the overall design.

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    always set the Can Grow property to "Yes" thinking that if there are more records, the subreport will grow on the form to fit them all, but I guess that's not how it works.
    can grow only applies if you print the form

    as far as subreport is concerned - in form design view, just drag the report onto it

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

Similar Threads

  1. Anyway to "Temporarily" turn on cascade deletes
    By GraeagleBill in forum Programming
    Replies: 3
    Last Post: 08-24-2016, 05:12 PM
  2. Replies: 11
    Last Post: 05-19-2015, 08:35 AM
  3. Replies: 8
    Last Post: 10-06-2014, 03:02 PM
  4. How to store values temporarily
    By Naveen Marapaka in forum Programming
    Replies: 8
    Last Post: 12-29-2012, 10:07 AM
  5. Temporarily Disable Multifield Index
    By datsyuk in forum Forms
    Replies: 6
    Last Post: 07-23-2012, 03:23 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