DoCmd line Issue: Occurs a Run-time error ‘2494’

Asked By 20 points N/A Posted on -
qa-featured

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

Docmd.OpenForm formname
Else
MsgBox "You are not authorized!",vbOKOnly
End if

Private Sub Open_Activities_Menu_Click()
If InputBox("Enter password") = "111111" Then
DoCmd.OpenForm Activities_Menu
Else
MsgBox "You are not authorized!", vbOKOnly
End If
End Sub

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.

SHARE
Answered By 0 points N/A #151374

DoCmd line Issue: Occurs a Run-time error ‘2494’

qa-featured

 

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. 

Login/Register to Answer

Related Questions