Generic Password

G

Guest

I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working timesheet form
I have. I don't need high security, I just need to keep the employees filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" & strName &
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd info
and reference Form_Login that has a dropdown of Employees and use the Dlookup
statement in my code. However, I'm confused of how Dlookup works with my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects thier name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
R

Rick B

If it were me I would not try to reinvent the wheel. Use the built-in
User-Level Security. After the user logs in once, they will have access
only to what they should. You will be able to use the UserID to filter
records so they can only see their own. You can even default in their
userid or name when they create a new time card.

If it were me, I'd undo all the home-grown security you've built and simply
use the built-in security.

You should make at least one backup, then read and reread all the
instructions, then dive in. You must follow ALL the steps IN ORDER or it
will not work.

Good Luck.

Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm


--
Rick B



jsc3489 said:
I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working timesheet
form
I have. I don't need high security, I just need to keep the employees
filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" & strName &
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd info
and reference Form_Login that has a dropdown of Employees and use the
Dlookup
statement in my code. However, I'm confused of how Dlookup works with my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects thier
name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
G

Guest

There's only one problem with that. I goto the "..." after Input Mask and an
error says "Microcrap Access can't start the wizard. This feature is not
currently installed blah blah blah". It can't find the Office1.cab that it
thinks should be on my desktop?!?!?
Unless there's another way?
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


Rick B said:
If it were me I would not try to reinvent the wheel. Use the built-in
User-Level Security. After the user logs in once, they will have access
only to what they should. You will be able to use the UserID to filter
records so they can only see their own. You can even default in their
userid or name when they create a new time card.

If it were me, I'd undo all the home-grown security you've built and simply
use the built-in security.

You should make at least one backup, then read and reread all the
instructions, then dive in. You must follow ALL the steps IN ORDER or it
will not work.

Good Luck.

Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm


--
Rick B



jsc3489 said:
I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working timesheet
form
I have. I don't need high security, I just need to keep the employees
filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" & strName &
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd info
and reference Form_Login that has a dropdown of Employees and use the
Dlookup
statement in my code. However, I'm confused of how Dlookup works with my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects thier
name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
R

Rick B

Does this question have anything to do with my previous post? I did not
recommend anything to do with an Input Mask.

Did you post this to your previous thread by mistake?


--
Rick B



jsc3489 said:
There's only one problem with that. I goto the "..." after Input Mask and
an
error says "Microcrap Access can't start the wizard. This feature is not
currently installed blah blah blah". It can't find the Office1.cab that it
thinks should be on my desktop?!?!?
Unless there's another way?
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


Rick B said:
If it were me I would not try to reinvent the wheel. Use the built-in
User-Level Security. After the user logs in once, they will have access
only to what they should. You will be able to use the UserID to filter
records so they can only see their own. You can even default in their
userid or name when they create a new time card.

If it were me, I'd undo all the home-grown security you've built and
simply
use the built-in security.

You should make at least one backup, then read and reread all the
instructions, then dive in. You must follow ALL the steps IN ORDER or it
will not work.

Good Luck.

Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm


--
Rick B



jsc3489 said:
I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working timesheet
form
I have. I don't need high security, I just need to keep the employees
filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" & strName
&
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd
info
and reference Form_Login that has a dropdown of Employees and use the
Dlookup
statement in my code. However, I'm confused of how Dlookup works with
my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects thier
name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for
that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
G

Guest

No, same post. I assumed that's what you were talking about. I've done some
research on the subject before I began this quest and that (input mask) was a
way to provde security. Forgive me for my attitude. I've only been working
with Access for two weeks and I'm very new to all of this. I was given this
task by my boss and he wants results fairly quickly. So my aggrivation level
is at defcon 5. I apologize.

Please go on.
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


Rick B said:
Does this question have anything to do with my previous post? I did not
recommend anything to do with an Input Mask.

Did you post this to your previous thread by mistake?


--
Rick B



jsc3489 said:
There's only one problem with that. I goto the "..." after Input Mask and
an
error says "Microcrap Access can't start the wizard. This feature is not
currently installed blah blah blah". It can't find the Office1.cab that it
thinks should be on my desktop?!?!?
Unless there's another way?
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


Rick B said:
If it were me I would not try to reinvent the wheel. Use the built-in
User-Level Security. After the user logs in once, they will have access
only to what they should. You will be able to use the UserID to filter
records so they can only see their own. You can even default in their
userid or name when they create a new time card.

If it were me, I'd undo all the home-grown security you've built and
simply
use the built-in security.

You should make at least one backup, then read and reread all the
instructions, then dive in. You must follow ALL the steps IN ORDER or it
will not work.

Good Luck.

Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm


--
Rick B



I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working timesheet
form
I have. I don't need high security, I just need to keep the employees
filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" & strName
&
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd
info
and reference Form_Login that has a dropdown of Employees and use the
Dlookup
statement in my code. However, I'm confused of how Dlookup works with
my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects thier
name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for
that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
R

Rick Brandt

jsc3489 said:
No, same post. I assumed that's what you were talking about. I've
done some research on the subject before I began this quest and that
(input mask) was a way to provde security. Forgive me for my
attitude. I've only been working with Access for two weeks and I'm
very new to all of this. I was given this task by my boss and he
wants results fairly quickly. So my aggrivation level is at defcon 5.
I apologize.

InputMasks have nothing to do with security with the possible exception that
if you provide a home-grown password entry form you can use an InputMask of
"Password" and it will cause asterisks to be displayed as the user types
instead of the actual characters. When using the *real* User Level Security
that comes with Access InputMasks never enter the picture.
 
G

Guest

I'll use that technique as well as what I'm trying to do, unless I can
incorporate them together.

Basically, all I'm trying to do is make sure Bob doesn't
accidentally/purposefully create Chucks timesheet. Each user will have a
unique password to access thier own timesheet. I'm trying to create user
level access from within the form.

If what your saying will do all of this, then count me in.

Thank you for all your effort and time. :) Smile, it's somebodies birthday
today.

(o \ | / o) VW Bug's rule! It's a car with camel toe!
 
G

Guest

This is only the second problem with that. I goto the User level security
wizard, the same $#!@#$ thing. "Microcrap Access can't start the wizard. This
feature is not
currently installed blah blah blah. Would you like to install? ". DUH!!!
But NO!!
It can't find the Office1.cab that it thinks should be on my desktop
again?!?!?

OH, THE HUMANITY!!!

SO, back to my original question and delema!!
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


jsc3489 said:
There's only one problem with that. I goto the "..." after Input Mask and an
error says "Microcrap Access can't start the wizard. This feature is not
currently installed blah blah blah". It can't find the Office1.cab that it
thinks should be on my desktop?!?!?
Unless there's another way?
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


Rick B said:
If it were me I would not try to reinvent the wheel. Use the built-in
User-Level Security. After the user logs in once, they will have access
only to what they should. You will be able to use the UserID to filter
records so they can only see their own. You can even default in their
userid or name when they create a new time card.

If it were me, I'd undo all the home-grown security you've built and simply
use the built-in security.

You should make at least one backup, then read and reread all the
instructions, then dive in. You must follow ALL the steps IN ORDER or it
will not work.

Good Luck.

Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm


--
Rick B



jsc3489 said:
I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working timesheet
form
I have. I don't need high security, I just need to keep the employees
filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" & strName &
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd info
and reference Form_Login that has a dropdown of Employees and use the
Dlookup
statement in my code. However, I'm confused of how Dlookup works with my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects thier
name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
R

Rick B

I could be wrong, but I think at least one of the links I sent you will walk
you through setting up US without the wizard.

--
Rick B



jsc3489 said:
This is only the second problem with that. I goto the User level security
wizard, the same $#!@#$ thing. "Microcrap Access can't start the wizard.
This
feature is not
currently installed blah blah blah. Would you like to install? ". DUH!!!
But NO!!
It can't find the Office1.cab that it thinks should be on my desktop
again?!?!?

OH, THE HUMANITY!!!

SO, back to my original question and delema!!
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


jsc3489 said:
There's only one problem with that. I goto the "..." after Input Mask and
an
error says "Microcrap Access can't start the wizard. This feature is not
currently installed blah blah blah". It can't find the Office1.cab that
it
thinks should be on my desktop?!?!?
Unless there's another way?
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


Rick B said:
If it were me I would not try to reinvent the wheel. Use the built-in
User-Level Security. After the user logs in once, they will have
access
only to what they should. You will be able to use the UserID to filter
records so they can only see their own. You can even default in their
userid or name when they create a new time card.

If it were me, I'd undo all the home-grown security you've built and
simply
use the built-in security.

You should make at least one backup, then read and reread all the
instructions, then dive in. You must follow ALL the steps IN ORDER or
it
will not work.

Good Luck.

Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm


--
Rick B



I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working
timesheet
form
I have. I don't need high security, I just need to keep the employees
filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" &
strName &
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd
info
and reference Form_Login that has a dropdown of Employees and use the
Dlookup
statement in my code. However, I'm confused of how Dlookup works with
my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects
thier
name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for
that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
D

Douglas J Steele

And while User-level Security is a very complicated proposition, it's better
done without the wizard.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Rick B said:
I could be wrong, but I think at least one of the links I sent you will walk
you through setting up US without the wizard.

--
Rick B



jsc3489 said:
This is only the second problem with that. I goto the User level security
wizard, the same $#!@#$ thing. "Microcrap Access can't start the wizard.
This
feature is not
currently installed blah blah blah. Would you like to install? ". DUH!!!
But NO!!
It can't find the Office1.cab that it thinks should be on my desktop
again?!?!?

OH, THE HUMANITY!!!

SO, back to my original question and delema!!
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


jsc3489 said:
There's only one problem with that. I goto the "..." after Input Mask and
an
error says "Microcrap Access can't start the wizard. This feature is not
currently installed blah blah blah". It can't find the Office1.cab that
it
thinks should be on my desktop?!?!?
Unless there's another way?
--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


:

If it were me I would not try to reinvent the wheel. Use the built-in
User-Level Security. After the user logs in once, they will have
access
only to what they should. You will be able to use the UserID to filter
records so they can only see their own. You can even default in their
userid or name when they create a new time card.

If it were me, I'd undo all the home-grown security you've built and
simply
use the built-in security.

You should make at least one backup, then read and reread all the
instructions, then dive in. You must follow ALL the steps IN ORDER or
it
will not work.

Good Luck.

Security FAQ

http://support.microsoft.com/?id=207793



The Security Whitepaper is also worth reading to help you understand.

http://support.microsoft.com/?id=148555



Joan Wild:

www.jmwild.com/AccessSecurity.htm



Lynn Trapp

http://www.ltcomputerdesigns.com/Security.htm


--
Rick B



I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working
timesheet
form
I have. I don't need high security, I just need to keep the employees
filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" &
strName &
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd
info
and reference Form_Login that has a dropdown of Employees and use the
Dlookup
statement in my code. However, I'm confused of how Dlookup works with
my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects
thier
name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for
that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
R

Rob Oldfield

If the idea is just to ensure that the identity of the person filling the
form in is correct, then you'd be better off skipping the idea of passwords
entirely. Just use this...

http://www.mvps.org/access/api/api0008.htm

....to grab the current user name and use that to identify the record.


jsc3489 said:
I'm two weeks old with Access so be gentle.

I'm trying to create a generic password system for a working timesheet form
I have. I don't need high security, I just need to keep the employees filling
out their own timesheet instead of accidently someone elses.
There are 18 employees at my company.

This is my Form_Login code so far:

---------------------------------------------
Option Compare Database
Option Explicit
---------------------------------------------
Private Sub Cancel_Click()
DoCmd.Close
End Sub
---------------------------------------------
Private Sub Submit_Click()

Dim stDocName As String

stDocName = "Password"
DoCmd.OpenForm stDocName

Exit_Submit_Click:
Exit Sub

Err_Submit_Click:
MsgBox err.Description
Resume Exit_Submit_Click

End Sub
__________________________________________________
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
This my From_Password code:

---------------------------------------------
Option Explicit
---------------------------------------------
Private Sub Form_Load()

gOkToClose = False
' number of tries
gintPasswordFlag = 1

End Sub
---------------------------------------------
Private Sub Form_Unload(Cancel As Integer)

If Not gOkToClose Then
Cancel = True
End If

End Sub
---------------------------------------------
Private Sub PASSWORD_AfterUpdate()
On Error GoTo err_PASSWORD_AfterUpdate

Dim strName As String
Dim strPassword As String

strName = Forms!login1.Login
strPassword = Me![Password]

If StrComp(Nz(DLookup("[Password]", "UserDef", "User_Name ='" & strName &
"'"), ""), strPassword, 0) = 0 Then
gOkToClose = True
Dim Employee
Employee = Forms!login1.[Login]
DoCmd.Close acForm, "Login1"
DoCmd.OpenForm "Timesheet", acNormal, "", "", acAdd, acNormal
Forms!timesheet.SetFocus
Forms!timesheet.Employee = Employee

DoCmd.Close A_FORM, "Password"
Else
' three tries
Select Case gintPasswordFlag
Case 1 To 2
DoCmd.Beep
MsgBox "Incorrect password", 16, "Password"
gintPasswordFlag = gintPasswordFlag + 1
Case Else
DoCmd.Beep
DoCmd.OpenForm "Fail"
End Select
End If
exit_PASSWORD_AfterUpdate:
Exit Sub

err_PASSWORD_AfterUpdate:
MsgBox "Error " & err & ": " & Error$, 0, "Password"
Resume exit_PASSWORD_AfterUpdate

End Sub
---------------------------------------------------------------------

Most of this code I got from very helpful people on here.

My biggest problem is designing my tables to work with this code.
I've been given suggestions to create Table_UserDef to hold Passowrd info
and reference Form_Login that has a dropdown of Employees and use the Dlookup
statement in my code. However, I'm confused of how Dlookup works with my
tables and where to put the info in my tables Dlookup needs to work.

How it (is supposed to) works:

Employee clicks on Login.htm (I will have to create) and selects thier name
from a dropdown list and clicks submit. A password box pops up and if
correctlty entered, closes and the timesheet Form pops up, ready for that
employee to fill in date, hours, etc..

I'm lost with the tables...please help.
 
R

Rob Oldfield

Off topic from the original post, but what makes you say that Douglas? I
find that the wizard is a very useful tool for getting the core security
settings in place (albeit generally requiring fine tuning). Are you
suggesting that it's a bad idea when people are starting out on figuring out
how user level security works, or in all situations?
 
D

Douglas J Steele

Both.

When people are starting out figuring out how it works, I think it's
important that they know what's going on, rather than relying on the Wizard.

For experienced users, I'm not sure it has the flexibility required.

But then, I'm a masochist who seldom uses the built-in Wizards in Access.<g>

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Rob Oldfield said:
Off topic from the original post, but what makes you say that Douglas? I
find that the wizard is a very useful tool for getting the core security
settings in place (albeit generally requiring fine tuning). Are you
suggesting that it's a bad idea when people are starting out on figuring out
how user level security works, or in all situations?
 
G

Guest

This isn't for security as much as it is preventive maintanace. Everyone who
fills in a timesheet will fill in there own by providing a password to
uniquely identify that person.

My Access is missing so much stuff that really, this is my only solution. I
try to install this, it can't find the required files, I try and install
that, same thing. I even have the CD's. Since this is a Dell computer, and
the version of MS Office I have is OEM, I get the run around between MS and
Dell. This takes much less time and frustration. Picking my battles ya know.
;)


--
I reject your reality and substitute my own.

Promote hydrogen - one of the best "clean" fuels there are!


Douglas J Steele said:
Both.

When people are starting out figuring out how it works, I think it's
important that they know what's going on, rather than relying on the Wizard.

For experienced users, I'm not sure it has the flexibility required.

But then, I'm a masochist who seldom uses the built-in Wizards in Access.<g>
 
D

Douglas J Steele

If all you care about is who they are, why do you need a password? As has
already been suggested to you, use the code at
http://www.mvps.org/access/api/api0008.htm at "The Access Web" to grab their
network ID. Or do your users not log off when they're done, so that multiple
users could be trying to update from the same session?
 
G

Guest

Douglas J Steele said:
users not log off when they're done, so that multiple
users could be trying to update from the same session?

Yes, this is exactly why. Since my last posting I've figured it all out and
it is now working perfectly. Now, I'm onto reports. It doesn't seem possible
to create user specific reports with my current layout so I'm going to have
to do some research if I have to change some things or not. Thank you all for
your suggestions and help, you'll be hearing from me again real soon. LOL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top