Results 1 to 2 of 2
  1. #1
    lannoe is offline Novice
    Windows XP Access 2003
    Join Date
    Nov 2006
    Posts
    7

    Command Button


    How do I set up a command button to print an evelope for the record selected?

  2. #2
    Join Date
    May 2010
    Posts
    339
    Put this behind a command button; don't forget to change the items in red to the real objects. An envelope is just like any other report. You will have to change the print orientation and a few minor tweaks but its no big deal.
    Code:
    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 = "[Your Primary Key] = " & Me.[Your Primary Key]
            DoCmd.OpenReport "Your Report", acViewNormal, , strWhere        
        End If

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

Similar Threads

  1. how to disable command button
    By archie in forum Access
    Replies: 1
    Last Post: 08-27-2009, 11:11 PM
  2. Command Button Help!
    By arthura in forum Programming
    Replies: 3
    Last Post: 06-30-2009, 12:55 PM
  3. Command button issue
    By sloppysly in forum Forms
    Replies: 8
    Last Post: 06-15-2009, 12:07 PM
  4. Duplicate command button
    By brettg in forum Database Design
    Replies: 1
    Last Post: 08-04-2008, 04:16 AM
  5. Command button code
    By lfolger in forum Forms
    Replies: 3
    Last Post: 03-25-2008, 04:26 PM

Tags for this Thread

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