Copy Field to Clipboard Problem (1 Viewer)

vito1010

Registered User.
Local time
Yesterday, 23:56
Joined
Aug 14, 2014
Messages
33
Hi,

Currently have this executing at a button press:

Code:
Private Sub GoIRS_Click()
   Me!Social.SetFocus
   DoCmd.RunCommand acCmdCopy
   FollowHyperlink "https://sa.www4.irs.gov/irfof/lang/en/irfofgetstatus.jsp"
End Sub

It's supposed to copy the field "Social" into the clipboard.
Unfortunatley, it only copies the 1st character (Social is Text).

Any assistance would be appreciated.

(FYI: The hyperlink goes to the IRS page "Where's My Refund?")
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:56
Joined
May 7, 2009
Messages
19,228
With DoCmd
.GoToControl "Social"
.RunCommand acCmdCopy
End With
 

vito1010

Registered User.
Local time
Yesterday, 23:56
Joined
Aug 14, 2014
Messages
33
That didn't work.....BUT, I copied the DB to my VM (Windows 11/Still Office 2013) and it DID work. I saw when I clicked the button, it highlighted the whole field, not just the first character/number. Any ideas why?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:56
Joined
May 7, 2009
Messages
19,228
it will highlight the Whole field.
if you need only certain number of characters, at certain
starting point, you go and google the Textbox properties:

SelStart and SelLength.
 

vito1010

Registered User.
Local time
Yesterday, 23:56
Joined
Aug 14, 2014
Messages
33
No. On my Win10 system, it only copies the first character of the field. When I copied and pasted the exact same db file to the Win11 VM, it copies the whole field.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:56
Joined
May 7, 2009
Messages
19,228
maybe it has to do with your MS Access Options.
open ms access.
on ribbon->file->options
select, Client Setting->Behaviour Entering Field->Select Entire Field.
 

GPGeorge

Grover Park George
Local time
Yesterday, 20:56
Joined
Nov 25, 2004
Messages
1,820
maybe it has to do with your MS Access Options.
open ms access.
on ribbon->file->options
select, Client Setting->Behaviour Entering Field->Select Entire Field.
In other words, that option, which applies to the Client, not the specific accdb, could be different on two different installations of Access. It may not be related to the Windows version at all, which I think is a red herring.
 

vito1010

Registered User.
Local time
Yesterday, 23:56
Joined
Aug 14, 2014
Messages
33
maybe it has to do with your MS Access Options.
open ms access.
on ribbon->file->options
select, Client Setting->Behaviour Entering Field->Select Entire Field.
Thank you. This fixed it. I don't know why it's different on the two systems? I installed them from the same files and never changed anything. Oh well, at least the problem was solved. Again, thank you.
 

cheekybuddha

AWF VIP
Local time
Today, 04:56
Joined
Jul 21, 2014
Messages
2,271
You should be able to code this so that it doesn't matter what settings the user has set in their version of Access:
Code:
Private Sub GoIRS_Click()
  With Me.Social
    .SetFocus
    .SelStart = 0
    .SelLength = Len(.Text)
  End With
  DoCmd.RunCommand acCmdCopy
  Application.FollowHyperlink "https://sa.www4.irs.gov/irfof/lang/en/irfofgetstatus.jsp"
End Sub
(nb untested)
 

Users who are viewing this thread

Top Bottom