Right-click Runtime (1 Viewer)

ECEK

Registered User.
Local time
Today, 01:19
Joined
Dec 19, 2012
Messages
717
Is there a way to right click in Access runtime to have a context list with cut paste and copy?

No ribbons or anything else. Please read the question again and please only contribute if you have a definitive answer or contribution.

I (and millions of other users) need a solution to this:banghead:

Both the "Allow Full Menus" and Allow Default Shortcut Menus" are ticked in my full version.

I hear about creating code to replicate this but it is vague as to what the result will be.

I suspect that the answer will be "No"
I know I can ctrl "C" etc but I just want my end user to be able to right click on a field and be able to paste data.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 01:19
Joined
Feb 19, 2013
Messages
16,553
Is there a way to right click in Access runtime to have a context list with cut paste and copy?
definitive answer - yes. Correct terminology is not 'context list', it is 'shortcut menu' - googling this will bring up plenty of examples.

Runtime does not provide access functionality such as right click (i.e. shortcut menus), navigation pane or ribbon. You need to write code to create your own shortcut menus and can create you own option or reference the existing menu options. The result will be a shortcut menu that displays in the same way

If you look to the bottom of this thread you will find some links where the same question has already been asked and answered. Plus here is another link

http://stackoverflow.com/questions/...-item-to-the-default-right-click-context-menu

If, as developer, you want to test the functionality from a runtime perspective, rename your file with .accdr rather than .accde or .accdb for testing purposes.

Also see the attached which provides the 'policy id' number you will need use for an existing menu option. Note that some options appear several times because they are used in different contexts (see tabs, tabsets, etc). Filter the controlname for paste and you will see a number of options for example.
 

Attachments

  • AccessControls.zip
    82.1 KB · Views: 409

ECEK

Registered User.
Local time
Today, 01:19
Joined
Dec 19, 2012
Messages
717
I shall get to work !! Many thanks CJ
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:19
Joined
May 7, 2009
Messages
19,169
alternative:

create a function in a module that we will call in a macro later:

Public Function fnCopyText()
Dim o As Object
On Error Resume Next
Set o = Screen.ActiveControl
If TypeName(0) = "TextBox" Or TypeName(o) = "ComboBox" Then DoCmd.RunCommand acCmdCopy
End Function

Public Function fnPasteText()
Dim o As Object
On Error Resume Next
Set o = Screen.ActiveControl
If TypeName(0) = "TextBox" Or TypeName(o) = "ComboBox" Then DoCmd.RunCommand acCmdPaste
End Function

next create a macro for your menu, named it mcrMenuItem

Submacro: Copy
RunCode
Function Name fnCopyText()

Submacro: Paste
RunCode
Function Name fnPasteText()

next, create another macro (named it mcrMenu)

AddMenu
....Menu Name (anyname here)
---Macro Menu Name mcrMenuItem (the first macro we made)


next,
put your form in design mode:
on Property->Others->Shortcut Menu Bar: mcrMenu

that will put your shortcut menu to the form.
you'll need to right click on the navigation pane whenever you want to edit the form again after running it coz your menu is already active.
 

ECEK

Registered User.
Local time
Today, 01:19
Joined
Dec 19, 2012
Messages
717
Hi Arnie

Im confused by this section:

next create a macro for your menu, named it mcrMenuItem

Submacro: Copy
RunCode
Function Name fnCopyText()

Submacro: Paste
RunCode
Function Name fnPasteText()




What I have done is create the macro like so:

RunCode
Function Name fnCopyText()
RunCode
Function Name fnPasteText()

Is this correct?

I do get a menu (of sorts)!!
When I right click on my form a small square white box appears but it has no content or anything to click ?
 

Users who are viewing this thread

Top Bottom