Run-Time error '2450':

Bucephalus

Registered User.
Local time
Today, 21:50
Joined
May 21, 2012
Messages
14
Hello,

could anyone pls help me on this?
I am trying to create a login form and end up with this error below,
I am just a beginner and I used this code which was already available in the internet.

Run-Time error '2450':

Microsoft Access cannot find the referenced 'frmlogin'.

the code:

Private Sub cmdadd_Click()
If DLookup("[AccessLevelID]", "tblUser", "[UserID] = " & Forms!frmlogin!cbouser) = 1 Then
MsgBox "Login Successful!", vbOKOnly
Else
MsgBox "Login Failed!You have only limited access!!", vbOKOnly
End If
End Sub
 
Do you actually have a form with the name frmlogin?
 
Yes,I do and that is the reason why I came here ;)
 
Is the Form (frmLogin) kept open when you try to run this code?
 
No,Its always closed and I also tried after checking your post by closing the form (frmlogin) and running the main form but still i'm getting the error :banghead:
 
The Login Form need to stay ope when you are trying to refer the controls..
 
Still having the same error? Did you check if cboUser is returning the desired value? Have you tried Debugging either by using popup message boxes or Stepping through the code to identify the source of your problem?

Finally, explain what is not working either way. Simply saying not working is not helping.
 

Users who are viewing this thread

Back
Top Bottom