Paste in Access from Excel - non-numeric entries fail

Each time and for a while, the user will complain about my fields in the Access application's application. I found out that they are right. Access in certain situations will simply stop receiving data from the copy and paste operations for a specific field, sequentially.

Almost as if Access considers that the inserted data is only numeric data, and then it sees that Alpha is trying to cast on a number, and then ignores it.

The following is not a native application, but a new Access file in which I simply copy and paste Excel data. I looked at the raw clipboard data using http://www.peterbuettner.de/develop/tools/clipview/ , but I do not see any obvious problems or format problems.

Thoughts?

Test application and data

+4
source share
3 answers

Perform the "paste special" operation and paste in plain text. For ease of use, I recommend that you attach the "insert special" button to the quick access toolbar.

Access sometimes gets confused when you let it guess what you are inserting. Paste as plain text is the best way to make it work.

Edit

Sample code for a right-click menu

Public Function CreateGeneralClipBoardMenu()
    On Error Resume Next
    CommandBars("GeneralClipboardMenu").Delete

    Dim cmb As Office.CommandBar

    Set cmb = CommandBars.Add("GeneralClipboardMenu", msoBarPopup, False, False)

        With cmb
            .Controls.Add msoControlButton, 21, , , True  ' Cut
            .Controls.Add msoControlButton, 19, , , True  ' Copy
            .Controls.Add msoControlButton, 755, , , True  ' Paste Special
        End With

    Set cmb = Nothing
End Function

Identifier # 755 is the magic number for the Insert Special function, and I found it in this list: http://support.microsoft.com/kb/213552

Where to install it in Access 2013. Access Settings - Current Database - Label Ribbon

Access Options - Current Database - Shortcut Ribbon Bar

+3
source
+2

[string, ] . , / , , .

0

Source: https://habr.com/ru/post/1537784/


All Articles