Results 1 to 4 of 4
  1. #1
    MiaAccess is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Mar 2011
    Location
    Texas
    Posts
    31

    Unhappy Access 2016 Report formatting issue

    Again my first two reports in Access 2016. I was trying to insert into the page header the name of the report and the date.
    I just inserted into the page header the following code:

    Option Compare Database

    Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
    If Me.Page = 1 Then ' no need to do it more than once
    Me.Caption = "Road Improvements Test for Wrong Rates " & Me![txtformatdate]
    End If

    End Sub

    Private Sub Report_NoData(Cancel As Integer)
    MsgBox "Current Week's tables are empty "
    Cancel = True
    End Sub



    It compares regular hourly rates to prevailing wage rates. However, there is not always overtime, so I have zero fields, because it is easier to overlook.

    I get the following error message:
    This form or report contains changes that are incompatible with the current database format. The form or report was not saved. In order to save your changes, you must remove any layouts that have empty cells in them and/or set the HasModule property for the form or report to no.

    There is no module, it is just this report opens from a form with the correct name and date inserted. Have not had problems with any other report. I set he HasModule to no, but it ignores my code, no it actually wipes it out.
    I don't understand what is incompatible with the database format, I really do not have empty fields in the detail, only code like" =IIf([othrs]=0,"",[OTRate])
    I have plenty of report with the same code and lots of real empty fields create in Access 2003 and 2010 without any problems.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Why bother setting Caption property?

    Why not just have a textbox in report header with the expression?
    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
    MiaAccess is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2011
    Location
    Texas
    Posts
    31
    I can put the text box into the header but how do I get it into the filename when printing to PDF?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    What method are you using to generate PDF. Is there a control on form with the date value? Or do you just want the current date? Maybe:

    DoCmd.OutputTo acOutputReport, "report name", acFormatPDF, "C:\folderpath" & "Road Improvements Test for Wrong Rates " & Format(Date(), "yyyymmdd") & ".pdf"

    The error message you encounter is one I've never seen. However, don't see how the code could be the source. I just tested your code and do not get the error.
    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.

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

Similar Threads

  1. Issue: Creating hyperlinks in Access 2016
    By BilStenson in forum Macros
    Replies: 6
    Last Post: 03-05-2019, 03:28 AM
  2. report printing in Access 2016
    By cfljanet in forum Reports
    Replies: 12
    Last Post: 11-02-2016, 10:28 AM
  3. Replies: 2
    Last Post: 04-19-2016, 04:09 PM
  4. Access 2016 Default Value Issue
    By breakingme10 in forum Forms
    Replies: 7
    Last Post: 09-23-2015, 10:07 AM
  5. Issue with Report Formatting
    By Nashskye13 in forum Reports
    Replies: 6
    Last Post: 10-26-2012, 04:20 PM

Tags for this Thread

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