Results 1 to 11 of 11

Thread: Input Box to Form

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    5

    Question Input Box to Form

    I have created an Inputbox PIN password function. It works great with the exception that the PIN number isn't hidden by astericks. I've seen messages saying to convert to the inputbox to a form. I've attached the coding that I use for the inputbox...could someone advise me on how to change the coding to include the form instead of the inputbox?

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    You seem to have missed off the attachment.


    Things I do when I am bored: DotNetable

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    5

    Coding

    OOps....Sorry bout that...

    Private Sub Ctl10_1_1_Enter()
    Dim strInputPin As String
    If Ctl10_1_1 <> "" Then
    strInputPin = InputBox("Unlock with original signer's pin:")
    Dim rsCheck As ADODB.Recordset
    Set rsCheck = New ADODB.Recordset
    rsCheck.ActiveConnection = CurrentProject.Connection
    rsCheck.CursorType = adOpenKeyset
    rsCheck.LockType = adLockOptimistic
    rsCheck.Open "Select * From tblTrainerSignOffs"
    rsCheck.Find "[strName] = '" & Ctl10_1_1 & "'"
    If rsCheck!strPin = strInputPin Then
    MsgBox ("Sign-off unlocked.")
    Else
    MsgBox ("Pin did not match. Stop cheating.")
    GoTo 998
    End If
    rsCheck.Close
    Set rsCheck = Nothing
    Else
    End If

    strInputPin = InputBox("Enter Sign-Off Pin:")

    Dim rsUsers As ADODB.Recordset
    Set rsUsers = New ADODB.Recordset
    rsUsers.ActiveConnection = CurrentProject.Connection
    rsUsers.CursorType = adOpenKeyset
    rsUsers.LockType = adLockOptimistic
    rsUsers.Open "Select * From tblTrainerSignOffs"
    rsUsers.MoveFirst
    Do Until rsUsers.EOF
    If rsUsers!strPin = strInputPin Then
    Ctl10_1_1 = rsUsers!strName
    GoTo 999
    Else
    rsUsers.MoveNext
    End If
    Loop
    999 rsUsers.Close
    Set rsUsers = Nothing

    998 [Command34].SetFocus

    DoCmd.RunCommand (acCmdRefresh)
    End Sub

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Looks VB6 code , do you have specific VB.NET question ?

  5. #5
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    [shiverring] you...put...goto...statements...in...your...code

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by thephantom
    [shiverring] you...put...goto...statements...in...your...code
    ??????

  7. #7

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    5

    Question Font and Goto

    THe problem is that I want the box to show passchar or a different font to hide what is inputted. I was wanting to know how to do this without making a form.

    And whats wrong with GOTO lines...it's been a great way of redirecting when needed?

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Isn't this VB6 Code ?????

  9. #9

    Thread Starter
    New Member
    Join Date
    Feb 2004
    Posts
    5

    VB

    Yeah...it's VB6.3

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by RobV10
    Yeah...it's VB6.3
    Even if it's VB6.9999999 it's still VB6 code and it's different than VB.NET . This forums is only for VB.NET Code . Did you post it in VB6 forum ?

  11. #11
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982
    Originally posted by thephantom
    [shiverring] you...put...goto...statements...in...your...code
    I think most will agree the only time the Goto statement should be used is in the line on error goto ErrorHandler. Anything other than this and you are getting into spaghetti code and any other developers attempting to look at your code would not thank you for that.


    Things I do when I am bored: DotNetable

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width