Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Posts
    48

    Unanswered: Error in Report Title

    I have used an expression in the report Header, as follow:-

    =" Item wise details Between " & Format(Forms!Form1.Text0,"dd-mm-yy") & " & " & Format(Forms!Form1.Text2,"dd-mm-yy")

    I have made a Form in which, through Command Button, macro is called to open the report in Preview Mode.

    When Preview button is selected, Report Header is perfectly displays, but when print button is selected (as available in MS Access Toolbar), report gets printed but Heading prints as :

    #Name?

    Is their any option to display Report Header correctly through Print Button in Preview mode?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    My guess is that you're closing the form. It must still be open when the report prints.
    Paul

  3. #3
    Join Date
    May 2008
    Posts
    48
    Form has not closed & is still open & if so, why Title is showing in preview mode and not in print mode.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The form must still be open when the report prints, as that queries the data again. A common mistake is to open the report in preview mode and then close the form. That would cause the behavior you're describing.
    Paul

  5. #5
    Join Date
    May 2005
    Posts
    1,191
    You could always try passing the value in Text0 as an OpenArg to the Report, and then applying it to the header OnOpen.
    Me.Geek = True

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Why not just format the date fields in the underlying query using an expression?

    ie..

    StartDate: Format([MyDateField],"dd-mm-yy") and then have a column for the EndDate: Format([MyDateField],"dd-mm-yy")

    or

    StartDate: Format(Forms!Form1!Text0,"dd-mm-yy") - note the ! versus . That way you can just add the StartDate field onto the report and you don't need to worry about it not printing.
    Last edited by pkstormy; 06-28-09 at 00:57.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •