Solved

Right Click to make record 'current'

Posted on 2016-07-19
4
46 Views
Last Modified: 2016-07-23
I have a continuous form in Access 2003 application.  The shortcut menu bar is set as ‘MainRightClick’ in the form properties.  ‘MainRightClick’ has all the options available for all lines on the continuous form.

Approximately twenty rows of data fit on the continuous form.   If the user right clicks on any record showing on the form, the record that they were hovering over when they right clicked becomes the current record and the right click menu pops up.  Any action selected from the right click menu is executed on the record where the right click occurred, because it became the current record.  This is exactly the way I want it to work.

I am putting together a new Access 2013 application with a form that I want to work the same way.  It is a continuous form with the ‘Shortcut Menu Bar’  defined as ‘frmProperty_Pre_RightClick_2013’.  frmProperty_Pre_RightClick_2013 is the popup menu.

The form works the same as the original Access 2003 form with one annoying exception.  The exception is: Hovering the mouse over any record on the screen and right clicking does not change the current record.  It does pop up the right click menu but whatever operation is selected is executed on whichever record happens to be current on the form.  To change the current record I have to first click in the record I want to be current, then right click.  I looked thru the options and properties on the old form and new form but I don’t see any differences.

How can I get the new Access 2013 screen to work like the old Access 2003 screen.  Meaning that whichever record the cursor is hovering over when the right click is pressed becomes the current record?
0
Comment
Question by:mlcktmguy
4 Comments
 
LVL 34

Assisted Solution

by:PatHartman
PatHartman earned 125 total points
Comment Utility
I never noticed this because I don't use custom right-click menus.  But, over the years, many good features of how the interface works have been lost simply because of sloppy coding changes on the part of the MS Access developers.  Most Access development cycles have new teams and so continuity is lost.  If the new programmer didn't know about an existing feature, he is quite likely to clobber it because he himself is not an Access user and doesn't recognize its value and general testing is probably not going to bring the loss of function to light.  I think you are SOL on this one.
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
Comment Utility
Instead of setting the forms shortcutmenubar property to the name of your shortcut menu, leave it blank and set the ShortcutMenu property to no.

Then use the Forms mouseup event to fire off your shortcut menu.  If you hover over the record selector and right click, it should select that record and then fire off your shortcut menu..

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Button = acRightButton Then CommandBars("frmProperty_Pre_RightClick_2013").ShowPopup
    
End Sub

Open in new window

Unfortunately, this will not work if you hover over a control on the form, then you would have to use the MouseUp event of that control.   A little more work but a reasonable workaround.
0
 
LVL 31

Assisted Solution

by:Helen_Feddema
Helen_Feddema earned 125 total points
Comment Utility
Trying to get an Access 2013 (or 2016) database to work just like a 2003 one is a difficult task, sometimes impossible, so you might be better off seeing how you can do what you need to do using the features of the 2013 database, rather than trying to replicate the old functionality, which (as Pat says) might not work any more because of Microsoft careless coding.
0
 
LVL 1

Author Closing Comment

by:mlcktmguy
Comment Utility
Thanks to all.  Never occurred to me that the functionality would just disappear.  At least I know now.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now