Drag and Drop: Behind the Scenes with Alessandro Grimaldi

Building Drag-and-Drop Interfaces in Access with Pure VBA (an Access User Group talk with Alessandro Grimaldi)

Drag and Drop: Behind the Scenes with Alessandro Grimaldi

When most Access developers think of drag-and-drop functionality, they assume it requires complex Windows API calls or advanced coding techniques. Not so!

In this Access Europe presentation, Alessandro Grimaldi breaks down his elegant approach to implementing drag-and-drop capabilities in Access applications using pure VBA and standard controls. Drawing from his extensive experience developing graphical interfaces for UN agencies and financial institutions, Alessandro demonstrates how just a few dozen lines of well-structured code can create sophisticated interactive interfaces.

Whether you're looking to enhance your forms with drag-and-drop capabilities or simply interested in learning advanced class-based development techniques, this presentation offers valuable insights into building more dynamic Access applications.

Background & Experience

  • Started programming in 1982
  • Focused on VBA/Access development since 1998
  • Worked for UN agencies in multiple countries
  • Specialized in graphical interface development
  • Five years at European Central Bank as VBA developer

Key Interface Examples

  • AIDA (2006) - Food distribution tracking system
  • Vessel Loader - Ship loading operations management
  • Happy Birthday - Port management system
  • Sliding Doors - Horizontal movement interface

Core Technical Approach

  • Uses pure VBA - no API calls required
  • Based on standard Access controls (labels, images)
  • Relies on three key mouse events:
    • MouseDown
    • MouseMove
    • MouseUp
  • Implements class-based architecture for scalability

Class Structure

Basic Implementation

  • Single class handling drag operations
  • Tracks object position and movement
  • Manages mouse event responses
  • 20-25 lines of core code

Advanced Master-Slave Pattern

  • Master class manages collection of objects
  • Slave class handles individual object behavior
  • Enables event handling for multiple objects
  • Provides clean interface to form code

Implementation Benefits

  • Simple to implement
  • Highly performant
  • Maintainable code structure
  • Reusable across projects
  • Scales well with multiple objects

Future Projects Preview

  • New book focusing on slider controls
  • Ribbonizer - Custom ribbon builder application featuring:
    • Real-time preview
    • Drag-and-drop interface
    • XML export capabilities
    • Code generation for callbacks

Conclusion

Alessandro's presentation demystifies drag-and-drop implementation in Access, showing how clean, class-based code can create sophisticated interfaces without complexity. His approach demonstrates that advanced UI features are within reach of any Access developer willing to embrace object-oriented programming concepts.

Recording

The full recording is available on YouTube:

Join Live!

Want to get even more out of these presentations? Join the live Access User Group events! The next upcoming events are listed on the AUG Event Calendar.

Attending live gives you the opportunity to:

  • Interact directly with presenters during Q&A sessions
  • Network with other Access developers
  • Share your own experiences and challenges
  • Get immediate answers to your specific questions
  • Participate in group discussions

With multiple user groups across different time zones (and languages!), you're sure to find a meeting time that works for your schedule.

Acknowledgements

  • Base cover image generated by FLUX-schnell
  • Initial draft generated by Claude-3.5-Sonnet

All original code samples by Mike Wolfe are licensed under CC BY 4.0