A family of Microsoft relational database management systems designed for ease of use.
Hi @Phillip Corbin
Thank you for reaching out to the Microsoft Q&A forum.
Based on the information you shared, I understand that when your Access database is stored on OneDrive, MS Access is able to add an ActiveX button to a form without any issues. However, when the same form is created from a thumb drive (USB), you encounter an “Invalid use of Null” error, which stops the ActiveX control from being created. This issue does not occur in older (non-Microsoft 365) versions of Access, and all other ActiveX controls appear to function normally.
After researching this behavior, it appears to be caused by a combination of security restrictions in Microsoft Access 365 and environment trust differences between OneDrive and removable media.
OneDrive is treated as a trusted/local location, while USB drives are considered untrusted or external. Access 365 applies stricter security rules to untrusted locations, which can restrict ActiveX initialization or block access to certain system values. This can result in expected values returning Null, leading to the Invalid use of Null error.
Please try to create an ActiveX button requires Windows to correctly register required OCX/DLL libraries. When running from a USB drive, Access may fail to access or register these components, causing missing references or Null values internally.
The Invalid use of Null error typically occurs when code attempts to assign or evaluate a Null value in a context that does not allow it. In secured environments (like Access 365 + USB), some system properties or control values may unexpectedly return Null. When the error occurs, click Debug to identify the exact line of code causing the issue. To help troubleshoot this properly, could you please:
- Share the VBA code behind the button
- Indicate which line triggers the error when Debug is clicked
You can send this information via private message if preferred.
I hope this explanation helps clarify why the behavior differs between environments.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.