Header Banner
WonderHowTo Logo
WonderHowTo
Microsoft Office
wonderhowto.mark.png
Gadget Hacks Next Reality Food Hacks Null Byte The Secret Yumiverse Invisiverse Macgyverisms Mind Hacks Mad Science Lock Picking Driverless

How to Password protect queries in Microsoft Access

Code snippet in Visual Basic for a password prompt.

The Microsoft Office Access 2007 relational database manager enables information workers to quickly track and report information with ease thanks to its interactive design capabilities that do not require deep database knowledge. In this Microsoft Access video tutorial, you'll learn how to force a password to be entered in order to run a query.

Here's the code:

Password.SetFocus

If Password = "Manager1" Then

MsgBox "Access Granted", vbInformation, "CD Shop"

MsgBox "Delete Query Active", vbInformation, "CD Shop"

DoCmd.RunMacro "M_ArchiveStock"

MsgBox "Deletion Confirmed"

Else

MsgBox "Please re-enter your Password."

End If

For detailed instructions on implementing the above code, watch this video how-to.

Apple's iOS 26 and iPadOS 26 updates are packed with new features, and you can try them before almost everyone else. First, check Gadget Hacks' list of supported iPhone and iPad models, then follow the step-by-step guide to install the iOS/iPadOS 26 beta — no paid developer account required.

Related Articles

Comments

No Comments Exist

Be the first, drop a comment!