Hi everyone!
I have a form that has two command buttons (Add, and Edit). If the user clicks Add, another form pops up asking for a username and password. If the user enters the username and password corrrectly, the login form closes, but nothing else happens. I want the frmAddMenWorshipform to come up now but I don't know what to do?
Thanks!
-Joseph
5 1644
And the problem is...I want to use this login form multiple times, so I can't put code in there to just open one specific frmAddMenWorship form. I have another form frmAddMenReading and frmAddMenSinging...etc...as well.
Here's my code... - Private Sub cmdAddMenWorship_Click()
-
-
'Open frmAddMenWorship to view
-
DoCmd.OpenForm "frmLogin"
-
-
'Open frmAddMenWorship
-
DoCmd.OpenForm "frmAddMenWorship"
-
-
End Sub
- Private Sub cmdEnter_Click()
-
-
'Check to see if data is entered into the UserName combo box
-
If IsNull(Me.cmbUsername) Or Me.cmbUsername = "" Then
-
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
-
Me.cmbUsername.SetFocus
-
Exit Sub
-
End If
-
-
'Check to see if data is entered into the password box
-
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
-
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
-
Me.txtPassword.SetFocus
-
Exit Sub
-
End If
-
-
'Check value of password in tblLogin to see if this matches value chosen in combo box
-
-
If Me.txtPassword.Value = DLookup("Password", "tblLogin", "[UserID]=" & Me.cmbUsername.Value) Then
-
UserID = Me.cmbUsername.Value
-
DoCmd.Close acForm, "frmLogin", acSaveNo
-
Else
-
intLogonAttempts = intLogonAttempts + 1
-
'If User Enters incorrect password 3 times login will close
-
If intLogonAttempts > 3 Then
-
MsgBox "Password Invalid. You cannot enter data!", vbCritical, "Restricted Access!"
-
DoCmd.Close
-
'Warn the user tht they have one more chance
-
ElseIf intLogonAttempts = 3 Then
-
MsgBox "Password Invalid. You have one more chance!", vbCritical, "Warning!"
-
'Ivalid Password
-
Else
-
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
-
Me.txtPassword.SetFocus
-
End If
-
End If
-
-
End Sub
does anyone know or have an idea how to do this? Maybe Me.OpenArgs?
I figured it out!
Since I have multiple forms that I would like to associate with frmLogin, I created a textbox on frmLogin that had the Visible control = False. When I selected Add on frmAddMenWorship it assigned a numerical value to the textbox and then opened frmLogin. Then, on frmLogin, i wrote a Select Case. If the user enters the correct password associated with the selected username, then I check the textbox's value on frmLogin and open the form, by case number, that matches the numerical value that I assigned to the textbox. Cool huh!
YAY!!
NeoPa 32,556
Expert Mod 16PB
I'm sorry that no-one seemed to find this or offer help Joseph, but you seem to have done a fine job on your own anyway ;)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Lou |
last post by:
Please can someone put me out my misery!
Im trying to find a multiple user/password protection script that will
redirect the specific user to a specific directory.
At the moment I have set up...
|
by: RICHARD BROMBERG |
last post by:
I am building a password protected ASP web site.
(http://www.allscrewedup.org)
When you go to this site there is a link in upper left corner (VIP) that
takes you to a Logon Screen.
The user...
|
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...
|
by: bill |
last post by:
I need to open a asp.net web form from a classic asp page, and pass a
username and password to the asp.net page. The username and password exist
as session variables in the classic asp...
|
by: mankolele |
last post by:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Simple Database Connection</title>
</head>
<body bgcolor="white">
<?php
$connection =...
|
by: Noel S Pamfree |
last post by:
Problem 1
=======
I need to create a page for a friend who operates a school website. She
needs to set up a page so that only the Governors can access it. I thought
I'd try to use JavaScript to...
|
by: roshina |
last post by:
Hi
Iam facing a problem in my project, developing a web site for online shopping in ASP on windows XP using IIS server.
All the validations are ok but the new password is not upadated in the data...
|
by: MIUSS |
last post by:
Hi
need an advice, I'm beginner with PHP. I got little problem:
I use this solution as login to get administration of my pages:
<?php
// if authorization isn't done we request it
if...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |