Results 1 to 7 of 7
  1. #1
    kris335 is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    23

    Print button no longer working

    Hi, I posted a bit on the forum last year when I was creating a database for my county's Christmas program. I found some awesome help here so now that I'm gearing up for another holiday season, I wanted some help with tweaks to my database.



    My first issue however, is that print buttons I created last year that worked FINE no longer seem to be working. I had someone help me with the code on those, so I have no clue why it's suddenly not working.

    My two buttons are "PRINT CHILD CARD" and "PRINT P/U CARD". Both are supposed to print without opening. The only CHILD CARD and P/U CARD I want it to print when I hit those buttons is the one that has the same CHILD CODE as the form I am currently viewing onscreen.

    Here is the combined code that worked last year:

    Code:
    End Sub
    Private Sub cmdPrint_Click()
        Dim strWhere As String
        If Me.Dirty Then    'Save any edits.
            Me.Dirty = False
        End If
        If Me.NewRecord Then 'Check there is a record to print
            MsgBox "Select a record to print"
        Else
            strWhere = "[Child ID] = " & Me.[Child ID]
            DoCmd.OpenReport "Child Card Print", acViewNormal, strWhere, strWhere
        End If
    End Sub
    Private Sub print_pick_up_card_button_Click()
        Dim strWhere As String
        If Me.Dirty Then    'Save any edits.
            Me.Dirty = False
        End If
        If Me.NewRecord Then 'Check there is a record to print
            MsgBox "Select a record to print"
        Else
            strWhere = "[Child ID] = " & Me.[Child ID]
            DoCmd.OpenReport "Child P/U Print", acViewNormal, strWhere, strWhere
        End If
    End Sub
    I'm not sure this is enough info for you to help with. I tried uploading a dummy of my database but I couldn't get it below the 500kb requirement. I can email you the dummy database if you think you can help.

    Thanks so much for your time.
    Kristy
    kristin.nash@dss.virginia.gov

  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,518
    What happens now? I'd try

    DoCmd.OpenReport "Child Card Print", acViewNormal, , strWhere

    as the first strWhere is in the Filter argument. During testing to save paper I'd use:

    DoCmd.OpenReport "Child Card Print", acViewPreview, , strWhere
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    kris335 is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    23
    Sorry. When you hit the print buttons, nothing happens. I tried what you suggested and it still just sits there. Nothing is being sent to the printer. It's the same printer as last year and other stuff prints. Curious.

    Thanks for trying.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Does any code in this database run? In 2007, the database either needs to be in a trusted location or you have to explicitly enable code to run.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    kris335 is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    23
    You're a genius! That was the problem!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    If "genius" is defined as a dope who has banged his head against problems so many times that he starts remembering the solutions, then yes, I'm a genius!

    Glad we got it fixed for you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,016
    Given the literally hundreds and hundreds of times we've seen the same problem posted here, and on other forums, you'd think the 'Boys of Redmond' could have added an error message that would pop when a user did something that attempted to execute code in a database that wasn't in a 'trusted location,' wouldn't you?

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 5
    Last Post: 10-26-2011, 02:59 PM
  2. Print Button
    By Meccer in forum Access
    Replies: 1
    Last Post: 03-15-2011, 07:31 AM
  3. Replies: 0
    Last Post: 02-22-2011, 05:04 AM
  4. Replies: 1
    Last Post: 02-18-2010, 01:02 PM
  5. Replies: 1
    Last Post: 11-29-2005, 08:47 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