Is there an (easy) way to catch a paste event in a form?

G

Gijs Beukenoot

Hi all,

Is there an (easy) way to catch a paste event?

I have a subform (cont. forms) showing records in a table; like
customer-orders. The form has recordselectors and is able to select
multiple records and paste them with another customer.
However, in some cases I want to give the user a warning or completely
deny the paste-action (but allow adding records one by one using the
form itself).
So, in that case, I would like to catch the paste-action and,
preferably, cancel it.
I do not want to trap the keyboard although that would be a possibility
(haven't tried this yet) if there is no alternative...

Many thanks

GB
 
T

TC

Gijs said:
I do not want to trap the keyboard

Why not? Set the form's KeyPreview property to true, and code the form
level KeyDown and/or KeyPress and/or KeyUp events. This gives you full
visibility of all keypresses & also lets you alter them or suppress
them completely.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Gijs Beukenoot

From TC :

Thanks TC, but I was looking for something else because I want to allow
the user to copy and paste contents of fields (I guess I can program
around that one) and, one some forms, allow the user to paste records.
But when using the ctrl-v/mouse/menu to paste, there is no way (as far
as I know) to prevent _multiple_ records from being pasted.

GB
 

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