Results 1 to 9 of 9
  1. #1
    nbdwt73 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2009
    Location
    Charlotte NC
    Posts
    12

    Post Report print failing after upgrade to Windows 11

    I have an Access system (Office 2019) that has been running on Windows 10 until recently. I upgraded to Windows 11 and began having problems with printing reports. The VB code has 2 reports that print sequentially - see code:



    Code:
    stDocName = "Shipping_Report"
    Set rs1 = CurrentDb.OpenRecordset("SELECT OrdersItems.*, Orders.OrderCustomer_Address1, Orders.DeliveryType, Orders.OrderCustomer_TruckStopNum, Orders.OrderCustomer_DelStopNum, Orders.PurchaseOrderNumber, Orders.Machine, Orders.RequiredByDate, Orders.OrderCustomer_CustomerType, Door_Type.TB_Panel FROM (OrdersItems INNER JOIN Door_Type ON Door_Type.[Door Type]=OrdersItems.DoorType) INNER JOIN Orders ON Orders.OrderID=OrdersItems.orderid WHERE ((((Orders.OrderCustomer_CustomerType)= 'Door') OR ((Orders.OrderCustomer_CustomerType) Is Null)) AND (Left(Orders.PurchaseOrderNumber,5) <> 'Quote') AND (Left(Orders.PurchaseOrderNumber,9) <> 'Inventory') AND (RIGHT(Orders.PurchaseOrderNumber,2) <> 'SO') AND (Orders.DeliveryType) = 'MM Truck' AND ((Orders.Machine) Is Null)) ORDER BY Orders.OrderCustomer_Address1")
    
    If Not rs1.EOF Then
            DoCmd.OpenReport stDocName, acViewDesign, , , acHidden
            Reports(stDocName).RecordSource = ("SELECT OrdersItems.*, Orders.OrderCustomer_Address1, Orders.OrderCustomer_TruckStopNum, Orders.OrderCustomer_DelStopNum, Orders.PurchaseOrderNumber, Orders.Machine, Orders.RequiredByDate, Orders.OrderCustomer_CustomerType, Door_Type.TB_Panel FROM (OrdersItems INNER JOIN Door_Type ON Door_Type.[Door Type]=OrdersItems.DoorType) INNER JOIN Orders ON Orders.OrderID=OrdersItems.orderid WHERE ((((Orders.OrderCustomer_CustomerType)= 'Door') OR ((Orders.OrderCustomer_CustomerType) Is Null)) AND (Left(Orders.PurchaseOrderNumber,5) <> 'Quote') AND (RIGHT(Orders.PurchaseOrderNumber,2) <> 'SO') AND (Left(Orders.PurchaseOrderNumber,9) <> 'Inventory') AND (Orders.DeliveryType) = 'MM Truck' AND ((Orders.Machine) Is Null)) ORDER BY Orders.OrderCustomer_Address1")
            DoCmd.OpenReport stDocName, acViewNormal
            DoCmd.Close acReport, "Shipping_report", acSaveNo
        End If
        rs1.Close
    
    
            stDocName = "Packing List"
            Set rs1 = CurrentDb.OpenRecordset("SELECT Orders.OrderID, Orders.CustomerFullName, Orders.OrderCustomer_Address1, Orders.Ordercustomer_Address2, Orders.DeliveryType, Orders.OrderCustomer_TruckStopNum, Orders.OrderCustomer_ShipDayNumber, Orders.OrderCustomer_DelStopNum, Orders.Ordercustomer_city, Orders.Ordercustomer_state, Orders.Ordercustomer_postalcode, Orders.OrderCustomer_Phone, Orders.OrderCustomer_Fax, Orders.OrderCustomer_terms, Orders.OrderDate, Orders.PurchaseOrderNumber, Orders.RequiredByDate, Orders.PromisedByDate, Orders.OrderName, Orders.Machine, Orders.inventory, Orders.Shipped, Orders.Invoice, Orders.FullName " _
                & "FROM Orders " _
                & "WHERE ((Orders.Machine) Is Null) AND ((Orders.DeliveryType) = 'MM Truck') AND (Left(Orders.PurchaseOrderNumber,5) <> 'Quote') AND (Left(Orders.PurchaseOrderNumber,9) <> 'Inventory') AND (RIGHT(Orders.PurchaseOrderNumber,2) <> 'SO') AND ((Orders.OrderCustomer_CustomerType) = 'Door') AND ((Orders.OrderCustomer_Address1) <> 'Inventory') AND LEFT(Orders.OrderCustomer_Address1,6) <> 'Marwin';")
            If Not rs1.EOF Then
                DoCmd.OpenReport stDocName, acViewDesign, , , acHidden
                Reports(stDocName).RecordSource = ("SELECT Orders.OrderID, Orders.CustomerFullName, Orders.OrderCustomer_Address1, Orders.Ordercustomer_Address2, Orders.OrderCustomer_TruckStopNum, Orders.OrderCustomer_ShipDayNumber, Orders.OrderCustomer_DelStopNum, Orders.Ordercustomer_city, Orders.Ordercustomer_state, Orders.Ordercustomer_postalcode, Orders.OrderCustomer_Phone, Orders.OrderCustomer_Fax, Orders.OrderCustomer_terms, Orders.OrderDate, Orders.PurchaseOrderNumber, Orders.RequiredByDate, Orders.PromisedByDate, Orders.OrderName, Orders.Machine, Orders.inventory, Orders.Shipped, Orders.Invoice, Orders.FullName " _
                    & "FROM Orders " _
                    & "WHERE ((Orders.Machine) Is Null) AND ((Orders.DeliveryType) = 'MM Truck') AND ((Orders.OrderCustomer_CustomerType) = 'Door') AND (Left(Orders.PurchaseOrderNumber,5) <> 'Quote') AND (Left(Orders.PurchaseOrderNumber,9) <> 'Inventory') AND (RIGHT(Orders.PurchaseOrderNumber,2) <> 'SO') AND ((Orders.OrderCustomer_Address1) <> 'Inventory') AND LEFT(Orders.OrderCustomer_Address1,6) <> 'Marwin' " _
                    & "ORDER BY Orders.RequiredByDate, Orders.OrderCustomer_Address1, Orders.PurchaseOrderNumber;")
                DoCmd.OpenReport stDocName, acViewPreview
                DoCmd.PrintOut , , , , 2, 0
                DoCmd.Close acReport, stDocName, acSaveNo
            End If
            rs1.Close
    Since the upgrade to Windows 11 the first report prints fine but the second does not print - no error, no message. If I flip the code so that the Packing List report is first then it will print and the other will not. I have tried other printers - no change. Seems related purely to Windows 11. This is happening in the system wherever I have multiple reports to print - not isolated to just these)

    One interesting clue - if I insert something like a msgbox question (Print report, YesNo) between the reports it works.

    Please suggest some idea!
    Last edited by nbdwt73; 02-04-2025 at 01:26 PM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Have you tried on another computer with Windows11?
    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
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    If you are going to muck around with reports in design mode at runtime, I would at least be saving it, before reopening in normal mode.

    Walk your code and see what it does.

    Also please place blocks of code within code tags.

    As the data appears to be all harcoded, why can you not use queries for the source?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    nbdwt73 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2009
    Location
    Charlotte NC
    Posts
    12
    We are in the process of moving all our machines to Windows 11. This problem occurs on all of the upgraded machines but works fine on the Windows 10 machines. All machines are running Office 2019.

  5. #5
    nbdwt73 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2009
    Location
    Charlotte NC
    Posts
    12
    Thanks for the reply... Oddly enough if I walk thru the code (F8) it works as it should (produces the 2 reports). This problem occurs only when run normally.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Perhaps a timing issue then?
    Put a delay loop between them for a few seconds?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2021
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Between the reports try:

    Code:
    DoEvents: DoEvents

  8. #8
    nbdwt73 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Nov 2009
    Location
    Charlotte NC
    Posts
    12
    SOLVED! Thanks for everyone's help here. I have learned another important lesson - never trust Microsoft (or in my case Canon) to confirm driver compatibilities - do it yourself. Turns out that the windows 11 print driver for Canon printers has an interesting bug. All of our laser printers are Canon - I borrowed an HP from a business nearby. Works fine...

    I have tried several other drivers for the Canon printers (both Canon and MS) - none work... New printers for us.

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Well the doevents would not hurt and possibly save a ton of money?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 3
    Last Post: 09-08-2020, 01:15 AM
  2. Upgrade to Windows 10 causing issues with Graphs
    By brian11670 in forum Access
    Replies: 2
    Last Post: 08-19-2019, 01:18 PM
  3. Replies: 5
    Last Post: 04-23-2019, 03:31 PM
  4. Replies: 3
    Last Post: 01-21-2017, 04:09 AM
  5. Replies: 2
    Last Post: 05-19-2010, 02:01 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