My problem is that I have to create a program that opens up a password screen when I access a file that I choose to be protected.
Please can somone help. It sounds quite simple but i am quite new to VB and have tried everything.
Later
Mike
Printable View
My problem is that I have to create a program that opens up a password screen when I access a file that I choose to be protected.
Please can somone help. It sounds quite simple but i am quite new to VB and have tried everything.
Later
Mike
if you just want to protect the file in your app, try this:
Code:' in a module
' this can be equal to anything
Const SECRETPASSWORD = "mydoghasfleas"
'in File/Open or whatever:
If IWantToBeProtected(FileName) = True Then
frmPassword.show 1
if frmPassword.txtpwd <> SECRETPASSWORD then
MsgBox "Sorry!"
Exit Sub
Else
Goto OpenFile
End If
End if
OpenFile:
' do stuff here
' in frmPassword with two controls, txtPwd and cmdOK
Private Sub cmdOK_Click()
Me.Hide
End Sub