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:
    281
    Guest
    Apr 6, 2004
  2. Steve Lowe

    Copy Text Field To ClipBoard

    Steve Lowe, Nov 23, 2005, in forum: Microsoft Access Forms
    Replies:
    2
    Views:
    243
    Steve Lowe
    Nov 24, 2005
  3. Guest
    Replies:
    2
    Views:
    417
    Guest
    Aug 9, 2006
  4. Guest

    Copy form field data to clipboard

    Guest, Apr 26, 2007, in forum: Microsoft Access Forms
    Replies:
    2
    Views:
    1,332
    Guest
    Apr 26, 2007
  5. Replies:
    0
    Views:
    614
  6. vb_Dumb

    Copy field to the Clipboard

    vb_Dumb, Nov 20, 2008, in forum: Microsoft Access Forms
    Replies:
    3
    Views:
    355
    vb_Dumb
    Nov 21, 2008
  7. Brian

    command button to copy parent data to subform field

    Brian, Feb 11, 2009, in forum: Microsoft Access Forms
    Replies:
    0
    Views:
    203
    Brian
    Feb 11, 2009
  8. Brian

    command button to copy parent data to subform field

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