2
I have a very simple code that checks if the user exists and returns a message "Guaranteed Access" or "Denied Access".
The problem is I need to call this sub 5 times, which will return 5 Msgbox. How could I ever return a single Msgbox with the 5 information saying type 'User Y does not exist...'?
Dim UserName
Dim UserPass
Dim Mateus: Mateus = "Math"
Dim SenhaMateus: SenhaMateus ="123"
Dim Chris: Chris = "Chris99"
Dim SenhaChris: SenhaChris = "@#23"
Dim Samurai: Samurai = "Samuca"
Dim SenhaSamurai: SenhaSamurai = "CH1N4"
Dim Kaguya: Kaguya = "Kaguy"
Dim SenhaKaguya: SenhaKaguya = "Naruto"
Dim Maroto: Maroto = "Marotinho"
Dim SenhaMaroto: SenhaMaroto = "78D99D"
Dim Jorge: Jorge = "Jorge"
Dim SenhaJorge: SenhaJorge = "Benjor"
Call ChecaUser(Mateus,SenhaMateus)
Call ChecaUser(Chris,SenhaChris)
Call ChecaUser(Samurai,SenhaSamurai)
Call ChecaUser(Kaguya,SenhaKaguya)
Call ChecaUser(Maroto,SenhaMaroto)
Call ChecaUser(Jorge,SenhaJorge)
Sub ChecaUser(UserName,UserPass)
if (UserName = "Jorge" and UserPass = "Benjor") then
MsgBox "Acesso Garantido"
Else
MsgBox "Usuario não existe"
End if
End Sub