OLE DragDrop not working RRS feed

  • Question

  • HelloI am trying to incorporate an OLEDragDrop procedure into a VBA form which is part of an Access database. When I try to select the OLEDragDrop event from a Listview object I get an error "User-Defined type not defined". When I have entered the following code manually:

    Listview1_OLEDragDrop(Data As MSComctlLib.DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, y As Single)

    MsgBox Data.Files.Item(1)

    End Sub

    I get a compile error when I try to run the form for the same reason.

    The object works fine in Excel but in Access I don't seem to be able to use this part of the listview. Does anyone know any way around this as I need to use it in Access rather than Excel?(On a side note, how do you add standard controls to the toolbox in the Access version of Visual Basic, 'Additional Controls' does not appear in the right click menu so I'm currently having to create objects in excel forms, export and then import to Access in order to use things like Listview and Treeview)

    • Edited by LeoClifton Tuesday, October 8, 2013 9:07 AM
    Tuesday, October 8, 2013 8:54 AM

All replies

  • I've managed to add the control to the toolbox but now have another problem; every time I try to insert the control into a form (within Visual Basic) it shuts Access 2010 down. I'm getting the standard "Microsoft Access has encountered a problem and needs to close. We are sorry...". After reloading the repaired database the same problem occurs. 

    I tested it in a brand new database to see if it was a problem with my existing one and the same problem occurred. Any input on this alongside the 
    Tuesday, October 8, 2013 11:38 AM