Command Button to copy multi-field data to clipboard

G

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?
 
G

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top