How do I loop a the cancel button here :
Do
StudentUserName = InputBox ("Please Enter a Student Username
?",_
"Student User Credentials")
If IsEmpty(StudentUserName) Then Wscript.Quit
Loop until StudentUserName <> ""
I want to loop to the start of the entire script.
iAnswer = Msgbox("Would you like to configure a Student ?" &vbCrLf &vbCrLf _
& "Select Yes to Continue, Select No to Configure a Staff !",vbYesNoCancel
+ vbquestion, _
"Config Script")
I've see this and asked a similar question before but have totally messed
it up. If possible can you please explain how you did it too. I am trying
to learn more about it.
The entire script is below:
***************************************************************************************************************
Dim user, StudentUserName, StaffUserName, StudentComputerName, StaffComputerName,
iAnswer, iConfirm
iAnswer = Msgbox("Would you like to configure a Student ?" &vbCrLf &vbCrLf _
& "Select Yes to Continue, Select No to Configure a Staff !",vbYesNoCancel
+ vbquestion, _
"Config Script")
If iAnswer = vbYes Then
user = "student"
ElseIf iAnswer = vbNo Then
user = "staff"
Else iAnswer = vbCancel
Wscript.Quit
End If
select case user
case "student"
Do Until iConfirm = vbYes
Do
StudentUserName = InputBox ("Please Enter a Student Username ?",_
"Student User Credentials")
If IsEmpty(StudentUserName) Then Wscript.Quit
Loop until StudentUserName <> ""
iConfirm = Msgbox("Please Confirm the following Information" &vbCrLf
&vbCrLf & _
"Student User Name: " & StudentUserName &vbCrLf &vbCrLf & _
"Select Yes to Continue, No to Change User Information ",vbYesNo + vbinformation,
_
"Student Details")
Loop
StudentComputerName = StudentUserName + "x"
msgbox "You username is " & StudentUserName
msgbox "You Computer Name is " & StudentComputerName
case "staff"
Do Until iConfirm = vbYes
Do
StaffUserName = InputBox ("Please Enter a Staff Username ?",_
"Staff User Credentials")
If IsEmpty(StaffUserName) Then Wscript.Quit
Loop until StaffUserName <> ""
iConfirm = Msgbox("Please Confirm the following Information" &vbCrLf
&vbCrLf & _
"Staff User Name: " & StaffUserName &vbCrLf &vbCrLf & _
"Select Yes to Continue, No to Change User Information ",vbYesNo + vbinformation,
_
"Staff Details")
Loop
StAffComputerName = StaffUserName + "x"
msgbox "You username is " & StaffUserName
msgbox "You Computer Name is " & StaffComputerName
end selec