Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 2.36 KB | None | 0 0
  1. Private Sub Form_Load()
  2.  
  3. Dim passwordGary As String
  4. Dim passwordLes As String
  5. Dim passwordMohammed As String
  6. Dim passwordNorah As String
  7. Dim passwordOscar As String
  8. Dim passwordPascale As String
  9.  
  10. Dim pass As String
  11. Dim password As String
  12. Dim username As String
  13. Dim datatype As String
  14. Dim thedate As Date
  15. Dim days As Date
  16. Dim micnum As Double
  17. Dim error As String
  18. Dim correct As Double
  19.  
  20. username = InputBox("Hello, please enter your name")
  21. Do While username <> "Gary" And username <> "Les" And username <> "Mohammed" _
  22. And username <> "Norah" And username <> "Oscar" And username <> "Pascale"
  23.     MsgBox "Sorry who are you?"
  24.     username = InputBox("Please enter your name")
  25. Loop
  26.  
  27. password = InputBox("Please enter password")
  28.  
  29. If username = Gary
  30.     pass = passwordGary
  31. End If
  32.  
  33. If username = Les
  34.     pass = passwordLes
  35. End If
  36.  
  37. If username = Mohammed
  38.     pass = passwordMohammed
  39. End If
  40.  
  41. If username = Norah
  42.     pass = passwordNorah
  43. End If
  44.  
  45. If username = Oscar
  46.     pass = passwordOscar
  47. End If
  48.  
  49. If username = Pascale
  50.     pass = passwordPascale
  51. End If
  52.  
  53. Do While password <> "pass"
  54.     MsgBox "Password is wrong!"
  55.     password = InputBox("Please enter your password")
  56. Loop
  57.  
  58. datatype = InputBox("Did you collect the data yourself?")
  59. If datatype <> "Yes" And datatype <> "yes" Then
  60.     datatype = InputBox("Who collected the data then?")
  61.     Do While datatype <> "Gary" And datatype <> "Les" And datatype <> "Mohammed" _
  62. And datatype <> "Norah" And datatype <> "Oscar" And datatype <> "Pascale"
  63.     MsgBox "Wrong name"
  64.     datatype = InputBox("Please re-enter a name?")
  65.   Loop
  66.  
  67. End If
  68.  
  69. thedate = InputBox("Please enter the date when data was collected")
  70. days = Date - thedate
  71. If days > 7 Or days < 0 Then
  72.     MsgBox "Please enter another date which is not out of date"
  73.     Do While days > 7 Or days < 0
  74.     MsgBox "Too OLD! please re-enter"
  75.     thedate = InputBox("Please enter the date")
  76.     days = Date - thedate
  77.  
  78.     Loop
  79. End If
  80.  
  81. micnum = InputBox("Please enter a micro number between 150.00 and 5.00")
  82. Do While micnum <> -1
  83.     If Not IsNumeric(Numbers) Or micnum > 150 Or micnum < 5 Then
  84.         error = MsgBox("ERROR. Please emter a number between 150.00 and 5.00")
  85.     Else
  86.         correct = correct + micnum
  87.     End If
  88.     micnum = InputBox("Please enter a micro number between 150.00 and 5.00")
  89.  
  90. Loop
  91. MsgBox correct
  92. End
  93. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement