ONLY 1 of many Win 10 PC crashes on acCmdPaste (1 Viewer)

bignose2

Registered User.
Local time
Today, 19:28
Joined
May 2, 2010
Messages
219
Hi,

I have 3 Windows 10 PC's running the same Access Database

Just upgraded the 4th & last PC 8.1 to Windows 10. Upgrade fine, no problems.

All other PC's work fine & have done so on the same code for years. This PC whilst old is pretty fast & better that a few laptops on 10. All same latest Versions & same office 365 up to date.

This below crashed on just this ONE PC
DoCmd.RunCommand acCmdPaste
- ERRORS, "Paste is not available at this time"

It still seems to have pasted?? but triggered my error catching, to investigate but thought ask just in case someone knew straight away.

Me!TempCopyPaste = strSource
Me!TempCopyPaste.SetFocus
DoCmd.RunCommand acCmdCopy
Me.Contents.SetFocus

DoCmd.RunCommand acCmdPaste
- ERRORS, "Paste is not available at this time"

Very strange just this one PC.

THanks I/A
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:28
Joined
Sep 21, 2011
Messages
14,046
I *think* someone else had a similar problem recently, and it reminded me of an excel problem that had the same reason in my last place of work.
Make sure you only have one copy of Office on the errant PC.

HTH
 

isladogs

MVP / VIP
Local time
Today, 19:28
Joined
Jan 14, 2017
Messages
18,186
That normally means the clipboard is empty. In other words nothing was copied
Check in Access options that the entire field is selected when entering a field.
Its under client settings.

You may need to add code with SelStart=0 as shown in bold below

Code:
Me.TempCopyPaste = strSource
Me.TempCopyPaste.SetFocus
[b]Me.TempCopyPaste.SelStart=0
Me.TempCopyPaste.SelLength=Len(Me.TempCopyPaste)[/b]
DoCmd.RunCommand acCmdCopy 
Me.Contents.SetFocus  

DoCmd.RunCommand acCmdPaste

Also check the following
1. Are there any missing references
2. Does the project compile
 
Last edited:

bignose2

Registered User.
Local time
Today, 19:28
Joined
May 2, 2010
Messages
219
Hi,

Thanks for your replies,

It is exactly the same code over 3 other PC's that has worked for years so really can't see it as coding issue.

It is actually runtime but I will load a accdb & compile on that PC, just in case the references somehow got upset during the WIn 10 install, weird thou!
 

isladogs

MVP / VIP
Local time
Today, 19:28
Joined
Jan 14, 2017
Messages
18,186
My first suggestion is a client setting! Nothing to do with your code and can differ on each PC. Adding SelStart / SelLength should deal with that
 

bignose2

Registered User.
Local time
Today, 19:28
Joined
May 2, 2010
Messages
219
Hi, thanks again for your replies,

Had to give up for a while and just make sure I used the other PC's for this function for a time but want to revisit.

The client setting were correct to included whole field, Had not changed from previous install.

I know things could change from Win 8.1 to 10 although surprised if an office setting changed but as I say it was working perfectly before & did nothing different.
The identical DB is running on other win 10pc's.

I tried
Me.TempCopyPaste.SelStart=0
Me.TempCopyPaste.SelLength=Len(Me.TempCopyPaste)
Did not help

The field is actually getting copied OK anyway, all the data is there so not an empty clipboard,
It just errors and halts.

The only thing I can think of is something to do with the rich text fields.

What I am actually doing is importing emails, I parse the data and copies & pastes.
This I find is the best/only way to maintain a lot of the html (or access version).

As I say it works perfectly on every other PC.

I can't think of any but wondered if update to Win 10 may have a setting to do with rich text?

Is a little tricky to test this install on this PC as in main office in use 99% of the time so not being able to replicate on my main design PC is a lot more restrictive.

Thanks I/A
 

isladogs

MVP / VIP
Local time
Today, 19:28
Joined
Jan 14, 2017
Messages
18,186
Hmm. Nothing obvious at the moment.

Did you check if there were any missing references?
Is that pc running a different combination of version/bitness of Access/Windows?

I think you may need to debug each step.
I have some code to check and use the contents of the clipboard which may be worth trying. See my example app SQL to VBA and back again
 

bignose2

Registered User.
Local time
Today, 19:28
Joined
May 2, 2010
Messages
219
Hi,
I think I have found out what is causing the problems

Why & why now I am not too sure, perhaps an office update.

Thank fully it started error'ing on my main PC giving me much better testing.

It is the Office clipboard!
I don't use or open, I only ever use Ctrl C & Ctrl P.

If I "clear all" office clipboard it works fine, until I close & reopen the database
That in itself is odd as the data is in the office clipboard is the same & normal & does not cause problems until I close the program & re-start. Same data in the clipboard but now does not like paste command.

Pleased I found a reason but cannot trust the clipboard anymore.
I can use ClipBoard_GetText etc for other use. but the reason I liked this was I am using it for html (RTF) and is really good at clearing the tags I don't want but keeping most of the formatting, in a way that plaintext does not do.

I really hope it does not mess with other functions I have, I use copy & paste a lot for carrying data to external programs but seems ctrl V is OK.

I will have to somehow code to remove the html tags I don't want but not as easy as it sounds.

It seems cannot turn office clipboard off fully & unchecking options does nto seem to help
 

Users who are viewing this thread

Top Bottom