How can I copy to clipboard in Access VB(without press Ctr-C)

M

marcve

I'd like a field's contens to be copied to the clipboard as soon as it gets
focus. I can use the 'got focus' event of course, but I can't find the code
that actualy copies the content of the field to the clipboard for further use
in other programs.
 
B

Bill Howell

This worked perfect for me. Thanks. I also need to put a carriage return
(new line) on the clipboard. I have tried including chr(10) & chr(13) in the
test but when repasted, it is not recognized. Anybody know what the ASC
character is that Notepad imbeds when you press the Enter key?
Thanks,
Bill
 
D

Dirk Goldgar

In
Bill Howell said:
This worked perfect for me. Thanks. I also need to put a carriage
return (new line) on the clipboard. I have tried including chr(10) &
chr(13) in the test but when repasted, it is not recognized. Anybody
know what the ASC character is that Notepad imbeds when you press the
Enter key?

In Windows, the standard new-line combination is CR+LF (carriage return
followed by line feed), which is Chr(13) & Chr(10), not the other way
around as you posted above. Or, in VBA, you can use the defined
constant vbCrLf.
 

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