Results 1 to 8 of 8
  1. #1
    talktime is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    21

    reports not prints data

    Hi All
    i m a newbie to access VBA, i want to print the current record from a form, i managed to do the coding for printing current record but



    when i print the button on the form it shows print preview of the current record but with no data, only controls on the reports shows not actual data. plz answer i need it.

    sorry for my bad English.

    i have attached the data base.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Is this what you used to print the current record? http://access.mvps.org/access/reports/rpt0002.htm

  3. #3
    talktime is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    21
    not the same, a little different but that code is doing well as for as current record is concern, it only do not prints data, coz when i click the print button on the form, it shows the preview of the report, which shows only controls not the actual data, i have attached the database so you can have a look at it. plz solve my problem

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    See if this works any better.

  5. #5
    talktime is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    21
    DoCmd.OpenReport "MyReport", acViewPreview, , "[SNo]= " & Me.lngPropertyID

    first of all thanks a lot!!! and plz could u explain what is the difference in my code and this code, coz that code was showing print preview but no data. and where my code was doing wrong.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your code was pointing to the form but not the control on the form that contained the [SNo] value you needed. You could have also used:
    DoCmd.OpenReport "MyReport", acViewPreview, , "[SNo]= Forms!Details.lngPropertyID"

  7. #7
    talktime is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2011
    Posts
    21
    thanks a lot buddy!!!!

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help. It looks like you are from the UAE. Welcome to the Forum.

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

Similar Threads

  1. Report prints garbage after page 3
    By chrysalid in forum Reports
    Replies: 2
    Last Post: 10-03-2011, 11:05 AM
  2. Date Paramater prints weird
    By NOTLguy in forum Reports
    Replies: 9
    Last Post: 10-20-2010, 07:58 AM
  3. Change way report prints
    By johnpaul in forum Reports
    Replies: 1
    Last Post: 10-01-2010, 11:17 AM
  4. only prints the same query - no matter what i have open
    By RedGoneWILD in forum Programming
    Replies: 9
    Last Post: 08-31-2010, 10:47 AM
  5. Report Prints Out Before Previewing
    By Schwagr in forum Reports
    Replies: 2
    Last Post: 03-18-2006, 02:15 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