Command Button to copy multi-field data to clipboard

Discussion in 'Microsoft Access Forms' started by Guest, Apr 11, 2005.

  1. Guest

    Guest Guest

    I would like to create a command button that will copy the contents of the
    name and address fields from current record onto the clipboard to paste into
    Word. Can anyone provide an 'easy' solution, please?
     
    Guest, Apr 11, 2005
    #1
    1. Advertisements

  2. Guest

    Guest Guest

    Here's one way--create an invisible disabled control on your form, called say
    txtFormAddr, whose Control Source is set to:

    =[Address] & Chr(13) & [City] & ", " & [State] & " " & [Zip]

    Chr(13) is a carraige return/line feed, and will place the last three fields
    on a second line. Then the command button code is:

    With Me!txtFormAddr
    .Enabled = True
    .Visible = True
    .SetFocus
    End With

    Application.RunCommand acCmdCopy

    ' Reset focus to the command button, or anywhere else you like
    Me!MyCommandButton.SetFocus
    With Me!txtFormAddr
    .Enabled = False
    .Visible = False
    End With

    End Sub

    Hope that helps. AND thanks for the suggestion; I can use this one too!
    Sprinks
    "ancient_hilly" wrote:

    > I would like to create a command button that will copy the contents of the
    > name and address fields from current record onto the clipboard to paste into
    > Word. Can anyone provide an 'easy' solution, please?
     
    Guest, Apr 11, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    230
    Guest
    Apr 6, 2004
  2. Guest

    Copy form field data to clipboard

    Guest, Apr 26, 2007, in forum: Microsoft Access Forms
    Replies:
    2
    Views:
    1,096
    Guest
    Apr 26, 2007
  3. Replies:
    0
    Views:
    495
  4. Brian

    command button to copy parent data to subform field

    Brian, Feb 11, 2009, in forum: Microsoft Access Forms
    Replies:
    0
    Views:
    179
    Brian
    Feb 11, 2009
  5. Brian

    command button to copy parent data to subform field

    Brian, Feb 11, 2009, in forum: Microsoft Access Forms
    Replies:
    0
    Views:
    164
    Brian
    Feb 11, 2009
Loading...

Share This Page