Results 1 to 7 of 7
  1. #1
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74

    Cannot print from a form

    Hello,


    I just had a problem with a certain form:
    On Form1, I have a check box called SELECT. When I select any one record, the report I get is blank. I need to select one more record to get a print out of the first one. To print any two, I must select those two, plus an additional one. So it is always the number required, plus one. Why is it so? How can I correct this?
    Thanks.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Where is your code? It sounds like the record hasn't saved, so add code to force it.

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

  3. #3
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Quote Originally Posted by pbaldy View Post
    Where is your code? It sounds like the record hasn't saved, so add code to force it.

    If Me.Dirty Then Me.Dirty = False
    Thanks for the reply.
    I tried it, but unfortunately, it did not solve my problem.

  4. #4
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Any other solutions?

  5. #5
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    pbaldy is correct.

    To force a record to be saved before you run your report, you could use:
    #1. RunCommand acCmdSaveRecord
    #2. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    #3. Me.Refresh
    #4. Me.Dirty = False

  6. #6
    Ayiramala is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Kerala, India
    Posts
    74
    Quote Originally Posted by lfpm062010 View Post
    pbaldy is correct.

    To force a record to be saved before you run your report, you could use:
    #1. RunCommand acCmdSaveRecord
    #2. DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    #3. Me.Refresh
    #4. Me.Dirty = False
    I added Me.Dirty = False to the After Update event of the check box, and it worked! All the time I was trying to use it everywhere, except the check box!

    Thanks to everyone for helping.

  7. #7
    cbende2's Avatar
    cbende2 is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jun 2014
    Location
    Louisiana
    Posts
    370
    Can only the original poster mark threads as solved now?

    EDIT: Never-mind, got it.
    Last edited by cbende2; 01-06-2015 at 09:22 AM. Reason: System took a minute to realize I was subscribed to thread.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-04-2014, 01:28 PM
  2. Replies: 5
    Last Post: 07-29-2014, 01:05 PM
  3. Replies: 6
    Last Post: 03-01-2014, 07:07 AM
  4. Replies: 1
    Last Post: 12-03-2012, 03:15 PM
  5. Replies: 5
    Last Post: 10-26-2011, 02:59 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