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

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Disable CTRL C whilst certain forma are open (VB6 and Access VBA)

    Author
    Topic
    #411848

    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

    Viewing 3 reply threads
    Author
    Replies
    • #895807

      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

    • #895808

      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

    • #895815

      Cross-posted and already answered in the Access Forum here.
      To prevent further divergence and duplication, further posts there please!

    • #895816

      Cross-posted and already answered in the Access Forum here.
      To prevent further divergence and duplication, further posts there please!

    Viewing 3 reply threads
    Reply To: Disable CTRL C whilst certain forma are open (VB6 and Access VBA)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: