Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows 95 Access function problem

Status
Not open for further replies.

Djbell

IS-IT--Management
Apr 22, 2002
175
GB
I am having problems when my database compiles in Windows 95 Machines, but Windows NT and 2000 are fine.

It gives me a compile error when I use the Dlookup function.

Here is my code

Sub main()

Dim add
add = 0

End Sub


Sub authorise()
If DLookup("[Password]", "User", _
"[Username]='" & Me![txtusername] & "'") = Me![txtpassword] Then
count2 = 0
count3 = 0
DoCmd.OpenForm "selection form"
Else
MsgBox "Incorrect Password, Please Try Again"
If add = 0 Then count2 = count3 + 1
count3 = count2
End If
End Sub

Private Sub Command4_Click()
If locked = -1 Then
Message2
ElseIf count2 = 3 And DLookup("[Password]", "User", _
&quot;[Username]='&quot; & Me![txtusername] & &quot;'&quot;) <> Me![txtpassword] Then
Message
Else
authorise
End If
End Sub
Sub Message()
MsgBox &quot;You have entered the incorrect password to many times&quot;
locked = -1
End Sub
Sub Message2()
MsgBox &quot;Your are locked out please contact a member of the IT staff&quot;
End Sub



Cheers

Djbell
 
Hi dj,

You seem to have a missing 'end if' in your 'authorize' function (immediately before the 'end sub' I think).

Regards,

Darrylle &quot;Never argue with an idiot, he'll bring you down to his level - then beat you with experience.&quot;
 
Hiya,

this could have something to do with your references: I've had compile errors on PCs running Win 98 because I'd used the ADO 2.7 library.
Check your list of references to see if any of them have MISSING in front. If so, change to an earlier equivalent.

Hope this helps
Cheerh

Nikki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top