Results 1 to 5 of 5
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    Printing a form record prints last printed record from another form.

    Usng A2007 and A2003. I have a file with several forms. There are 3 different major forms for each type of device. Each of the three major forms is made up of single forms for a customer and quotation number for that device. The user screen is that same single form for customer and quotation. When the user wants to print the screen, I use code that I found on a website:



    Me.NotWantedSubform.visible=False (also allows to avoid landscape format )

    Dim PagePrt As Integer
    PagePrt = 2 * Form.CurrentRecord - 1 ' Without this, get couple blank pages
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.PrintOut acPages, PagePrt, PagePrt


    The problem is that when I click to print, it will print the last printed record from one of the other item forms instead of the record on the current form. When I click print a 2nd time, it correctly prints the selected record. I have preceded the code with refresh, requery etc., no effect.

    Any help much appreciated-driving me crazy.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Save your sanity and build a report to print. I do have a process for printing form but only because it is for archived legacy data and is seldom used, if ever.

    You have 3 forms open? Each type of device requires a different form structure?
    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
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Problem is that when I try to print a report (different code), get same problem-it tries to re print whatever the last request was. I don't have all 3 forms open at same time. I think that this is a corruption,, I have had some other weird problems. Thanks for reply.,




    Quote Originally Posted by June7 View Post
    Save your sanity and build a report to print. I do have a process for printing form but only because it is for archived legacy data and is seldom used, if ever.

    You have 3 forms open? Each type of device requires a different form structure?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    That is weird. Provide the report printing code or the db for analysis if you still need help.
    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.

  5. #5
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    You are right-weird. I pulled out the CD and ran the repair utility and that fixed it. Should have done that before I posted and wasted people's time. This is the 2nd time in past month that I have had to run it (for different reason). Maybe I should remove and re-install? Thanks for pitching in. The expertise available on this site is amazing.


    Quote Originally Posted by June7 View Post
    That is weird. Provide the report printing code or the db for analysis if you still need help.

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

Similar Threads

  1. Replies: 4
    Last Post: 02-17-2015, 06:49 AM
  2. Replies: 2
    Last Post: 06-20-2012, 02:21 AM
  3. Printing form record issues
    By rmohebian in forum Access
    Replies: 3
    Last Post: 03-06-2011, 02:33 PM
  4. Printing form record issues
    By rmohebian in forum Forms
    Replies: 0
    Last Post: 03-03-2011, 01:17 PM
  5. Printing Error:Prints form instead of report
    By jordanturner in forum Access
    Replies: 1
    Last Post: 12-08-2010, 04:42 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