N/APosted on - 05/24/2012
I have a problem with my MS Access. I’m trying to use a method of password protecting a command button that I found here. But it doesn’t work properly. The errors are shown below:
If InputBox("password") = "thepassword" then
MsgBox "You are not authorized!",vbOKOnly
Private Sub Open_Activities_Menu_Click()
If InputBox("Enter password") = "111111" Then
MsgBox "You are not authorized!", vbOKOnly
I think the issue is about the DoCmd line, and here I get a message.
Run-time error '2494':
The action or method requires a Form Name argument
Thanks in advance.
DoCmd line Issue: Occurs a Run-time error ‘2494’
Run-time error '2494' is normally occurs when either a DDL file is not registered on the computer or when it is missing. This is a common problem experienced by most Microsoft Windows users and more often than not, their computers crash now and then if the problem is not solved. To fix the problem,
You can download the missing DLL files from the internet and use it to re-register the registry list on your computer.
1. Click on start>run
2. Then type in regsvr32 c:windowssystem32dllfile (use the file downloaded from the internet)
3. Finally, re-start the computer
Alternatively, you can run a free registry scan for your computer. This will not only fix the Runtime error 2494 but will also help in avoiding other runtime errors. You can find various registry repair tools from the internet which you can download and use. These tools will scan, analyse and fix errors on your computer.