Results 1 to 4 of 4
  1. #1
    wsammy is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2017
    Posts
    5

    Print a single record - fields are being shown but no data.

    I was wondering if you could help me with a little problem, at least I thought and think it must be simple, but it has cost me hours so far because I thought I'll be able to figure it out somehow...

    I made my access "database" pretty simple:
    - One Table with all the data needed
    - One Form - where people will put in data (additionally a button: cmdPrint and a scond one "done" (doubleclick) so that a new empty form reloads.)
    - One Report (opens onClick "cmdPrint")

    My little problem is: I only want the actual data to be printed and that's my code:


    Private Sub cmdPrint_Click()
    On Error GoTo Err_cmdPrint_Click
    DoCmd.OpenReport "MarketReport", , , "MarketID =" & Me!MarketID
    Exit_cmdPrint_Click:
    Exit Sub
    Err_cmdPrint_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrint_Click
    End Sub



    It seems to work:
    - It does print 1 page with all the fields, but they are empty!
    - the weirdest thing ever... it did work 1 to 2 times with the correct data but even though I havent changed ANYTHING, it doesn't work anymore, the fields are empty. Right after it worked, I made a backup of the file but it doesn't work on the original nor on the backup up file anymore) It just shows empty fields.

    - I do have Autonumber (Fieldname = MarketID)

    Table:
    "Fieldname" = MarketID (data type: Autonumber)
    Form:


    "control element" = MarketID
    Report:
    "control element" = MarketID
    (sorry, it's probably not control element, I am not sure what it is called in English)


    Thank you so much for your help!
    Sammy

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Are you trying to print newly created records? If so, commit the data first:

    If Me.Dirty Then Me.Dirty = False
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    wsammy is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2017
    Posts
    5
    Thank you so much! I literally tried to figure it our for hours but now it starts to make sense why the fields but no data were shown. Thank you!

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    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. Print Report for Single Record
    By Ryanm0085 in forum Reports
    Replies: 13
    Last Post: 05-03-2017, 08:33 AM
  2. Print out single record onto a report
    By CQCDave in forum Access
    Replies: 2
    Last Post: 04-23-2015, 06:54 AM
  3. Print out single record onto a report
    By CQCDave in forum Access
    Replies: 14
    Last Post: 01-08-2015, 12:55 PM
  4. Print Single Record
    By stattech in forum Reports
    Replies: 5
    Last Post: 10-05-2010, 03:38 AM
  5. How to print a single Record's report?
    By yes sir in forum Access
    Replies: 7
    Last Post: 09-20-2010, 07:31 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