private....
dim username, password as string
username = textbox1.text
password = textbox2.text
if username = "myuser" and password = "mypassword" then
msgbox "You entered the correct info", vbInformation
Unload Me 'unload this form
else
msgbox "You entered the wrong info", vbcritical
'now close the workbook
ActiveWorkbook.close
End if
End sub
--------------
private...
'show the form when the workbook is open
UserForm1.show
End sub
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন