borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Updating list bos)Next Topic (Dbf Linkage.) New Topic New Poll Post Reply
AndreaVB Forum : Database : Password
Poster Message
jilkin
Level: Guest


icon Password  Archived to Disk

Can anyone help me with a bit of code that when button Clicked Displays Msgbox what is Password Then only If correct Password Given will close form.
Realy appreciate it if you can help me Jilkin.

21-05-2002 at 12:36 PM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1617
icon Re: Password  Archived to Disk

If you want the password to be entered in the "MsgBox" then you have to use an inputbox (or just load another form for just the password). Messageboxes don't allow text to be inserted.

but the following will give a general idea:

Private fAllowExit as Boolean

Private Sub GetPassword()
     Dim PWD as String
     Dim sRet as String

     fAllowExit=False
    
     PWD = "password"
' For inputbox
     sRet = InputBox("Password", "Password")
     If sRet = PWD then fAllowExit=True
' For Just putting in a form
     if FormName.txtPassword.Text=PWD Then fAllowExit=True
End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    Cancel = Not fallowexit
End Sub

21-05-2002 at 05:34 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : Database : Password
Previous Topic (Updating list bos)Next Topic (Dbf Linkage.) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder