VB validate security code

Charlie

Board Regular
Joined
Mar 1, 2002
Messages
134
I am trying to code an app that will validate a user entered security code.
So far I havent got very far.
I am trying to use sub-procedures which are new to me.

Option Explicit

Private Sub BuildCode(pCodeEntered As String, pNumber As String)

End Sub

Private Sub cmdAddOne_Click()

'Output digit in picbox
picOutput.Print (1)
End Sub

Private Sub cmdAddTwo_Click()

'Output digit in picbox
picOutput.Print (2)
End Sub

Private Sub cmdAddThree_Click()

'Output digit in picbox
picOutput.Print (3)
End Sub

Private Sub cmdCheckCode_Click()
Dim pNumber As String
pNumber = 331221
If pNumber = pNumber Then
picOutput.Print "Access Granted"
ElseIf pNumber < pNumber > pNumber Then
picOutput.Print "Access Denied"
End If
End Sub

Private Sub cmdExit_Click()
'Terminate Application
End
End Sub

Private Sub Form_Load()
'Declare required storage
Dim CodeEntered As String




Show
CodeEntered = ""
Digits = 0
picOutput.Print "Enter a six digit number"
End Sub

Charlie
 
The code I am using produces the same result whatever the input so the question of loops or GoTo's is irrelevant.
My copy of VB came down the pipe from Kazaa no help files were included unfortunately.
Thankyou for the advice.
Charlie
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top