Copy Highlighted Text

BLeslie88

B Leslie
Local time
Today, 20:52
Joined
May 9, 2002
Messages
228
I have a field that attains focus, CustNo on a seperate database outside our normal application.

I would like to automatically copy it to windows clipboard. I have tried a few forums searches and google searches and do not want to download that clip program I found. This is the only time I want to copy selected text at this time. On Got_Focus, as it is the first tab'd control.

:rolleyes:

By the way, this is my first round back and have already found many tids of useful tips over last week after a 2 year lay off. Nice to be back and see this place so very active.
 
I've never done it, but you might want to look into the .SelText property.
There are several "Sel" properties available, so to do what you want, you will probably need to look into these.

I am not sure if this will provide a solution or not - but would be where I would start.

-dK
 
The following is an example using the GotFocus Event of textbox Text0:
Code:
[COLOR="Navy"]Private Sub[/COLOR] Text0_GotFocus()
    DoCmd.RunCommand acCmdCopy
[COLOR="navy"]End Sub[/COLOR]
 
Learn something new everyday - I know I did .... thanks ByteMyzer!

-dK

Can't tip the rep scales to you because I have to spread some around. =[
 
Last edited:
I stumbled across the macro version of that when I started Access in 95. GoToControl DoMenuItem/Copy. Then SelectObject for the other form and then GoToControl DoMenuItem/Paste. It did not know how to do SetValue at that time so that was my way:)
 

Users who are viewing this thread

Back
Top Bottom