Results 1 to 3 of 3
  1. #1
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Disable CTRL C whilst certain forma are open (VB6 and Access VBA)

    I've tried everywhere to get this solution. but no joy.
    Surely some clever person out there knows the answer.

    I need to be able to disable the use of CTRL C to copy.
    This only needs to happen on when certain forms are active so AUTOKEYS is no use.
    I can lose all the menus, it is the CTRL C that foxes me.

    I had a dabble with variations of KeyDown and KeyPress events Iin Access) which I have used before
    but I cannot wrap my head round whether they could stop this or if so how.
    Anyone got any solutions or a direction to a suitable site.

    I need to do this in an Access database, but it might also turn up in a vb app as well.
    I am guessing that there must be some clever API that does it because in Excel when a macro is assigned to say CTRL c it takes priority
    over the standard CTRL C copy, so something is checking the keyboard there.

    Thanks
    Andrew

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable CTRL C whilst certain forma are open (VB6 and Access VBA)

    Hi Andrew

    In the _KeyDown(KeyCode As Integer, Shift As Integer) event procedure, can you use something like:

    If KeyCode = vbKeyC And Shift = vbCtrlMask Then
    MsgBox "Can't copy from here!", vbExclamation

    Alan

  3. #3
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Disable CTRL C whilst certain forma are open (

    Cross-posted and already answered in the Access Forum <!post=here,423570>here<!/post>.
    To prevent further divergence and duplication, further posts there please!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •