[AccessD] "Simulate" copy and paste of entire column in Runtime?

Ryan W wrwehler at gmail.com
Tue Jan 31 08:37:23 CST 2017


With the use of the runtime we've lost the ability to click a column header
and right click and select copy/paste. You can still use ctrl-c and ctrl-v,
but my users.... aren't sure about key combos.


I'm tinkering with trying to get some mouse events to do it for me:


    If Button = acRightButton And Shift = 1 Then
        DoCmd.CancelEvent

        Dim rst As DAO.Recordset
        Me.Rpt.SetFocus

        Set rst = Me.RecordsetClone
        DoCmd.GoToRecord , , acLast
        DoCmd.GoToRecord , , acFirst

        Me.SelTop = 1
        Me.SelHeight = rst.RecordCount
        commandbars("MyCommandBar").showpopup
        Set rst = Nothing
    End If


This works in highlighting the entire column (I have to use acLast,acFirst
to get the entire column if the datasheet has a scroll bar other wise it
just copies what's been loaded into the view.

But when my command bar comes up and I click "copy", it's not getting that
rows selection.  It's getting something else that's in focus even though
Me.Rpt.setfocus was called in code.

If I remove the commandbars popup and do DoCmd.RunCommand acCmdCopy that
appears to work but then I need to hash out special key combos for copy and
paste (in this case I'm using shift + right mouse up) to invoke copy, since
right mouse up all by itself invokes a different "toggle on/off" popup for
the entire column.


Does anyone have another take on this or should I just drop it and let them
get used to Ctrl-C,Ctrl-V?


More information about the AccessD mailing list