473,775 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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("Pleas e 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 5164
On 3 Oct 2006 07:01:54 -0700, "jpr" <jp***@tin.itwr ote:

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("Pleas e 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("Pleas e 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.itwr ote:

Pseudo-code:
if UserWantsAnothe rTry 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("Pleas e 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
3976
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 form that opens in the front end, I added the following to the form_open event: Dim cnn As ADODB.connection Set cnn = New ADODB.connection cnn.Provider = "Microsoft.Jet.OLEDB.4.0" cnn.Properties("Data Source") = "C:\backend.mdb"
3
2337
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 connection string requires a the database password even though the user entered it to open the database. How can I get the password from the system to build the connection string? Thanks for any help, Whitey
15
9742
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 solution only worked well for insert and delete, but not select. <% if Request.QueryString("Action") = 1 then username = Trim(request.form("username")) password = Trim(request.form("password")) if username <> "" and password <> "" then
1
4885
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 'Retrieve Password' under the logon form. the idea is to submit an email address and the password is emailed to the user. (a very "basic" but common function of user management systems). The script(s) I'm using are based on...
1
2634
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 that represents this table, so the admin can change the password if needed at ease.
1
2490
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 text in this table? Please tell me how I can use encode/decoder algorithm to secure password. User form coding is as follows :-
7
3482
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. ResetLogin.asp (where user will have to enter their username, old password, and new password). <TR> <TH ALIGN=LEFT> <FONT FACE="HELVETICA,HELV,ARIAL" SIZE=2>&nbsp;&nbsp;User Name: </FONT></TH> <TD><INPUT CLASS="bluebox"...
8
6265
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 "test" Please show me how to do it Thanks in advance I had code below
3
5558
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 the "password" they registered with. I have posted my code below. However, I get an error on line 31: Message = "You're password is:" & <%=objRS("Password" )%> The input name="email" on the html form that leads to this asp page.
0
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10046
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4014
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.