Advertisement
Guest User

Untitled

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