473,395 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

password to open form

jpr
Hello, I have a simple question.

I would like to restrict the opening of a form using a password. My
database it's already quite secure therefore it's just an additional
way to avoid users to intrude in this form.

On the OnLoad event I have added this code:
Dim strInputBox As String, bytChoice As Byte
InputPoint:
strInputBox = InputBox("Please input the password.", "Password
Required - Restricted Area! ")
If Len(strInputBox) 0 Then
If strInputBox <"***" Then
bytChoice = MsgBox("Wrong password" & vbNewLine & vbNewLine & "Do
you want to try another?", vbExclamation + vbYesNo, "Warning")
If bytChoice = vbYes Then
GoTo InputPoint
End If
Else
DoCmd.OpenForm ("myform")

End If
End If

Something is here not working correctly as whatever option I select
(yes or no) it will open my form.
What I need is that when I select No, it will prompt again to type the
password, while if I click YES, it will open my form.

Thank you for any help.

Oct 3 '06 #1
4 5135
On 3 Oct 2006 07:01:54 -0700, "jpr" <jp***@tin.itwrote:

Your code should be moved to the Form_Open event and if the password
is not given, set Cancel=True.

-Tom.

>Hello, I have a simple question.

I would like to restrict the opening of a form using a password. My
database it's already quite secure therefore it's just an additional
way to avoid users to intrude in this form.

On the OnLoad event I have added this code:
Dim strInputBox As String, bytChoice As Byte
InputPoint:
strInputBox = InputBox("Please input the password.", "Password
Required - Restricted Area! ")
If Len(strInputBox) 0 Then
If strInputBox <"***" Then
bytChoice = MsgBox("Wrong password" & vbNewLine & vbNewLine & "Do
you want to try another?", vbExclamation + vbYesNo, "Warning")
If bytChoice = vbYes Then
GoTo InputPoint
End If
Else
DoCmd.OpenForm ("myform")

End If
End If

Something is here not working correctly as whatever option I select
(yes or no) it will open my form.
What I need is that when I select No, it will prompt again to type the
password, while if I click YES, it will open my form.

Thank you for any help.
Oct 3 '06 #2
jpr
thanks. but where should I add the cancel true?
Dim strInputBox As String, bytChoice As Byte
InputPoint:
strInputBox = InputBox("Please input the password.", "Password
Required - Restricted Area! ")
If Len(strInputBox) 0 Then
If strInputBox <"***" Then
bytChoice = MsgBox("Wrong password" & vbNewLine & vbNewLine & "Do
you want to try another?", vbExclamation + vbYesNo, "Warning")
If bytChoice = vbYes Then
GoTo InputPoint
End If
Else
DoCmd.OpenForm ("myform")

End If
End If

Something is here not working correctly as whatever option I select
(yes or no) it will open my form.
What I need is that when I select No, it will prompt again to type the
password, while if I click YES, it will open my form.

Thank you for any help.
Oct 3 '06 #3
On 3 Oct 2006 07:13:32 -0700, "jpr" <jp***@tin.itwrote:

Pseudo-code:
if UserWantsAnotherTry then
Goto InputPoint
else
'User wants to quit
Cancel=True
end if

-Tom.

>thanks. but where should I add the cancel true?
>Dim strInputBox As String, bytChoice As Byte
InputPoint:
strInputBox = InputBox("Please input the password.", "Password
Required - Restricted Area! ")
If Len(strInputBox) 0 Then
If strInputBox <"***" Then
bytChoice = MsgBox("Wrong password" & vbNewLine & vbNewLine & "Do
you want to try another?", vbExclamation + vbYesNo, "Warning")
If bytChoice = vbYes Then
GoTo InputPoint
End If
Else
DoCmd.OpenForm ("myform")

End If
End If

Something is here not working correctly as whatever option I select
(yes or no) it will open my form.
What I need is that when I select No, it will prompt again to type the
password, while if I click YES, it will open my form.

Thank you for any help.
Oct 3 '06 #4
jpr
OK, its' working now. Thanks.

Oct 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris | last post by:
I have a frontend that has some tables which are linked to a backend. Now I want to make the backend password protected and when I try to run it password protected I can't open it. In the first...
3
by: Whitey | last post by:
I have a password secured database. After the password is entered the user has a form that I created that allows them to search the database and retrieve information. The problem is that the...
15
by: Eugene Anthony | last post by:
Is this method of validation for password and username considered to be secured. In my previous post I was given a solution that uses command object and the values are parsed by parameters. But the...
1
by: Andrew Murray | last post by:
I'm a novice at coding and cannot get the script below to work I'm receiving an Error 500 in the web browser when trying to run this script. The site is www.murraywebs.com and the link is...
1
by: dan.cawthorne | last post by:
Hi all, Need Some Help With A Simple Password Form What a I Have Is Single Field Table, With One Record In It The Field is Called table is also called "Password" which ive created a form...
1
by: pawan123 | last post by:
Hi, I am using VB6 and SQL Server 2000. I want to design a logon form. In this form, how can I use a Password field to store in encrypted form in tbluser table and how can I compare password...
7
by: hotflash | last post by:
Hi All, I want to creat a script where I will allow user to reset their own password. I have tried different options but don't have any luck. Wonder what I want to do is kinda not valid or not. ...
8
by: Mai Le | last post by:
Hello, I used Microsoft Access to create a login form with Name Password Access Level Admin and User I would like to let Admin login and open MRB form and User login then open other form like...
3
by: jerrydigital | last post by:
Hi, I am working on a forgotpassword.asp page. I would like the user to enter their email address, and click submit. Upon submit, an email will be sent to the user's email address provided with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.