Setting up a form to print one label for a specific record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yappy77
    New Member
    • Apr 2010
    • 37

    #1

    Setting up a form to print one label for a specific record

    I am using code for printing a label for a specific record from the following website:

    ** Edit ** Removed link

    When I try to execute using the print button on my form, I get an error (see attachment).

    Please help. I am not great with code so I will need specific code to make this will work properly.

    Thank you!

    Yappy
    Attached Files
    Last edited by NeoPa; Aug 6 '10, 10:28 PM. Reason: Removed illegal link to competing forum site
  • Steven Kogan
    Recognized Expert New Member
    • Jul 2010
    • 107

    #2
    You have an extra line after the line separator.

    Simply remove the blank line between 'msgbox' and 'vbOKOnly' and it should work.

    You'll probably get a faster responses if you do need to use an attached file: people are hesitant to open attachments.

    Code:
    MsgBox "Can't print an unsaved record", _
    vbOKOnly, "Error"

    Comment

    • yappy77
      New Member
      • Apr 2010
      • 37

      #3
      Thanks Steven for your help. I changed the line as you suggested & it is working!

      Would it be possible to add code to the existing code so that I could specify the number of labels to skip when printing the record specific label?

      Thanks,
      Yappy

      Comment

      • Steven Kogan
        Recognized Expert New Member
        • Jul 2010
        • 107

        #4
        There is an article on how to do that at:
        ** Edit ** Removed link
        Last edited by NeoPa; Aug 6 '10, 10:28 PM. Reason: Removed illegal link to competing forum site

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32669

          #5
          I'm sorry guys, but the rules forbid linking to competing forum sites.

          If you have a question or an answer it can be posted here in full, without reference to questions or solutions posted on such sites.

          Comment

          • yappy77
            New Member
            • Apr 2010
            • 37

            #6
            Thanks, Steven for all your help! I have everything working fine now.

            Comment

            • yappy77
              New Member
              • Apr 2010
              • 37

              #7
              Thanks NeoPA for the heads up. I will keep that in mind for future posts.

              Comment

              Working...