do - while loop for login of 3 attempts 
Author Message
 do - while loop for login of 3 attempts

Hi All,

Could someone please help me with my vb assignment.
we have to create a password login form which should only allow user 3 attempts to login using a Do - While Loop.

any suggestions will be a great help.

--
Fabian Bernard
Home Ph: (03) 9360 5635
Work Ph: (03) 9275 4249
Mobile Ph: (0412) 018 564

                        Or



Sat, 26 Jun 2004 11:37:23 GMT  
 do - while loop for login of 3 attempts

Hi All,

Could someone please help me with my vb assignment.
we have to create a password login form which should only allow user 3
attempts to login using a Do - While Loop.

any suggestions will be a great help.

DALE:

Try adding code like this to the "Login" Form:

In the General Declarations section of the form's module add the following
declarations:

Dim intUserTries as integer

This will create the integer with a default value of zero.

In the Click event of the "Login" command button put code like the
following:

Dim strPassword as String
Dim strUserEntry as String

   strPassword = "Password"
   strUserEntry = Me.txtPassword.Text

    If strPassword = strUserEntry then
       'Put code for proper login response here
       intUSerTries = 0
   Else
        intUserTries = intUserTries + 1
        If intUserTries > 2 then
            MsgBox "You have used the wrong password three times. " & _
             "The Application will now Shut Down.", vbOKOnly +  vbCritical,
_
             "Too Many Login Tries"
            Quit
      End If
   End If

--
Cordially;
E. DALE FRANKS JR. MCP MOUS

Dissent is morally neutral. You can correctly call yourself a dissident
because you like to kick puppies, but at the end of the day, you're just a
jerk who likes to kick puppies.
--Jonah Goldberg



Sat, 26 Jun 2004 13:01:42 GMT  
 do - while loop for login of 3 attempts
On Tue, 8 Jan 2002 14:37:23 +1100, "Fabian Bernard"

Quote:

>Hi All,

>Could someone please help me with my vb assignment.
>we have to create a password login form which should only allow user 3 =
>attempts to login using a Do - While Loop.

Ok, so you need a form, a textbox, an ok and cancel button.
Also a bit of code to test for the number of attempts.  
Try and do something with that, post some code and we'll guide you
through it.  
It wont help your learning (or anyone else's)  if we just write the
code for you.

Regards, Frank



Sat, 26 Jun 2004 13:43:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Crystal's Looping Login

2. Crystal's Looping Login

3. While Doing Loop Goto Exit and Do Wend

4. using a command button to change what a loop is doing

5. do loop is doing me in = (

6. login.bat -> login.vbs help required

7. NH: Need to have user login with their NT login

8. ADO thinks DBMS is done, but DBMS ain't done

9. Loop within a loop

10. loop de loop

11. NEWBIE HELP - Do-loop while loop

12. Exiting loops and for/next loops

 

 
Powered by phpBB® Forum Software