Question

Locked

help

By kavitha_v_pillai ·
I am writing an application in HTML using vbscript. The appication would check password and if the password is correct it will open another html page. How do I write the statement in vbscript? I would appreciate any help
Thanks

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Try this

by unhappyuser In reply to help

Private Sub txtpword_Exit(Cancel As Integer)

' Check username and password for access to database
Dim strquery As String
Dim FundName, varpass, varstatus As Variant

varpass = DLookup("[pword]", "userid", "[userid]='" & Me!txtuserid & "'")

If txtpword = varpass Then
FundName = DLookup("[fund name]", "form", "[formidlink]='" & Me!txtuserid & "'")
Me!labelfundname = FieldName
varstatus = DLookup("[userlevel]", "userid", "[userid]='" & Me!txtuserid & "'")

DoCmd.RunMacro "mcrsuccessfulQuery"

If varstatus = "Administrator" Then
Me!btnsecmenu.Visible = True
Me!labelsecmenu.Visible = True
Me!btnfinrpt.Visible = True
Me!labelfinrpt.Visible = True
Me!btnnotice.Visible = True
Me!labelnotice.Visible = True
'ElseIf varstatus = "Notice" Then
' Me!btnnotice.Visible = True
' Me!labelnotice.Visible = True
'ElseIf varstatus = "Report" Then
' Me!btnfinrpt.Visible = True
' Me!labelfinrpt.Visible = True
' Me!btnnotice.Visible = True
' Me!labelnotice.Visible = True
ElseIf varstatus = "name" Then
Me!btnnotice.Visible = True
Me!labelnotice.Visible = True
Me!btnfinrpt.Visible = True
Me!labelfinrpt.Visible = True
End If

Else
Me!btnsecmenu.Visible = False
Me!labelsecmenu.Visible = False
Me!btnfinrpt.Visible = False
Me!labelfinrpt.Visible = False
Me!btnnotice.Visible = False
Me!labelnotice.Visible = False
DoCmd.RunMacro "mcrfailurequery"
Msgbox "Invalid UserID or Password, Please try again"

End If
End Sub

Back to Software Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums