PDA

View Full Version : Solved: Login Screen / Password Call & Validation Issue



Acer76e
07-04-2009, 03:53 PM
I have a really awesome log where users open it up, and can input call data to track all our Supervisor Calls to the call center I work in.

I've enhanced the spreadsheet quite a bit, but have a need to protect from just anyone going into the form. Other associates are accessing the form and deleting what has logged. So I want to restrict the access to only a certain number of users.

I've created the login page, and another page with the user IDs and passwords, but now here's where I'm stuck.

What's the best way to have excel / VBA search and compare against that worksheet of User IDs and Passwords for each of the text boxes...and then if they match, do an unload of the form, and load of the input form.

And then if it returns as FALSE, basically someone just trying to log in that shouldn't be in...it loads the failed screen for example.

It might sound like an easy concept, but I've just come up on a roadblock on this one. Thanks for your help in advance.

The form is a little too large to post here, but if you want to see it, I can e-mail it to you, just hit me back.

mdmackillop
07-04-2009, 04:03 PM
Welcome to VBAX
Have a look at this thread (http://www.vbaexpress.com/forum/showthread.php?t=26847&page=2)
Enter name "admin" password is "1"

rbrhodes
07-04-2009, 07:49 PM
Hi Acer,

Perhaps post at a free site?

ie: http://www.4shared.com/

Acer76e
07-05-2009, 09:30 PM
Thanks rbrhodes!

I've uploaded the file to the following link for review.

4shared.com/file/116226010/679c1d01/OFS_Log_V77.html

mdmackillop
07-05-2009, 11:47 PM
Posted file

rbrhodes
07-06-2009, 03:42 AM
Hi acer,

Had way too much fun with this one! Read the code and the comments...


http://www.4shared.com/file/116267328/d10b90c/OFS_Log_V771.html

PS: There is a button behind the "Login" image on the Welcome form to allow for tabbing from textboxes to Login.

Usernames and passwords and security are as follows:

78209, honors01, 1
667, neighbour, 2
649, noUsedcar, 2
42, theAnswer, 3

All case sensitive at this time although the code is there for you to change that, Also the passwords are masked with * and that is in the textbox properties (passwordChr).

...have fun...

D_Rennie
07-06-2009, 05:46 AM
An example of a login form. There will still need to be changes to suit your needs and usernames passwords ECT. This example is basically to demostrate caplock display feature and the x "close"

Had a quick peek at one of the file "OFS LOG examples here and that looks like there is a fair bit going on there

D_Rennie

Acer76e
07-06-2009, 06:29 AM
rbrhodes -- thank you so much! The form is awesome and works like a charm!

Glad you had fun, the entire thing was a project that my job let me work on to develop, so it was awesome to be able to work on something I enjoy doing rather than what they want me doing, LOL

Thank you so much again...:bow:

D_Rennie
07-06-2009, 07:57 AM
:) How many hidden little jems are withen this Workbook. "FormWelcome" "Label4"

rbrhodes
07-06-2009, 02:50 PM
Hi,

I was tempted to put in "Easter eggs", for sure. I think 2...or 3 made it.

D_Rennie
07-06-2009, 07:59 PM
You have done great work.
Ill sit down and take a close look at what is going on in it. "ill try to find the other ester eggs"
its verry clean and im sure ill learn a lot from you approach.

D_Rennie.

Bob Phillips
07-07-2009, 12:55 AM
Hi acer,

Had way too much fun with this one! Read the code and the comments...


http://www.4shared.com/file/116267328/d10b90c/OFS_Log_V771.html

PS: There is a button behind the "Login" image on the Welcome form to allow for tabbing from textboxes to Login.

Usernames and passwords and security are as follows:

78209, honors01, 1
667, neighbour, 2
649, noUsedcar, 2
42, theAnswer, 3

All case sensitive at this time although the code is there for you to change that, Also the passwords are masked with * and that is in the textbox properties (passwordChr).

...have fun...

I got a debug error on selecting the Data worksheet

D_Rennie
07-07-2009, 05:27 AM
I noticed that aswell.
Not sure what the final object for the user_level layout would be i didnt say nothink.
Though from what i can see the error deals with the Security level of the user. And that sheet being xlveryhidden. "This Workbook"
And user/password. "module FormCode"
Select Case Level
Case Is = 1
'Just me
Sheets("Input").Visible = True
Case Is = 2
For Each sht In Worksheets
'All except 'Login' (Passwords)
If sht.Name <> "Login" Then
sht.Visible = True
End If
Next sht
Case Is = 3
For Each sht In Worksheets
'All
sht.Visible = True
Next sht
End Select
D_Rennie

D_Rennie
07-07-2009, 06:53 AM
I also got another error Withen "FormInput" With Private Sub ComboTopic_AfterUpdate()

With Sheets("Lists")
If IsNull(ComboTopic.Value) = False Then ComboSubtopic.Visible = True
If ComboTopic.Value = .Range("a1") Then
For counter = 2 To 60
Set curCell = .Cells(counter, 1)
ComboSubtopic.AddItem curCell.Value
Next counter
End If

If ComboTopic.Value = .Range("b1") Then
For Counter1 = 2 To 60
Set curCell = .Cells(Counter1, 2)
ComboSubtopic.AddItem curCell.Value
Next Counter1
End If

If ComboTopic.Value = .Range("c1") Then
For Counter2 = 2 To 60
Set curCell = .Cells(Counter2, 3)
ComboSubtopic.AddItem curCell.Value
Next Counter2
End If

If ComboTopic.Value = .Range("d1") Then
For Counter3 = 2 To 60
Set curCell = .Cells(Counter3, 4)
ComboSubtopic.AddItem curCell.Value
Next Counter3
End If
End Sub

The Error seams to be solved using Private Sub ComboTopic_AfterUpdate()
Dim counter
Dim curCell
Dim Counter1
Dim Counter2
Dim Counter3

With Sheets("Lists")
If IsNull(ComboTopic.Value) = False Then ComboSubtopic.Visible = True
If ComboTopic.Value = .Range("a1") Then
For counter = 2 To 60
Set curCell = .Cells(counter, 1)
ComboSubtopic.AddItem curCell.Value
Next counter
End If

If ComboTopic.Value = .Range("b1") Then
For Counter1 = 2 To 60
Set curCell = .Cells(Counter1, 2)
ComboSubtopic.AddItem curCell.Value
Next Counter1
End If

If ComboTopic.Value = .Range("c1") Then
For Counter2 = 2 To 60
Set curCell = .Cells(Counter2, 3)
ComboSubtopic.AddItem curCell.Value
Next Counter2
End If

If ComboTopic.Value = .Range("d1") Then
For Counter3 = 2 To 60
Set curCell = .Cells(Counter3, 4)
ComboSubtopic.AddItem curCell.Value
Next Counter3
End If
End With
End Sub

Cheers
D_Rennie

rbrhodes
07-07-2009, 02:09 PM
Hi,

Seems like a new thread to me but "wothtehell, archy". The original post was how to set up passwords...

As for the errors:

The Form error is indeed the lack of variable declaration ( I always use Opton Explicit). The Data form error was because Sheets are being actvated to run code. I changed both of those in this version.

Perhaps the Level one user needs at least the data form visible for viewing Perhaps protected from changes? But that's really up to the OP so I didn't change that...

Thanks for the debug guys!

Revised WB at:

http://www.4shared.com/file/116601324/351c1d4d/OFS_Log_V772.html

mdmackillop
07-07-2009, 02:48 PM
As threads can be meaningless without samples, can you please post files within VBAX?