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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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.
 
Back
Top