It can be used behind a button but it depends how and why you are creating the password.
Does it need to create a random password for a new user, then set the password? Is it a user password using access security to login to a database???
If so I am not sure how you would build it into the process of adding a new user. Perhaps you just have a menu option that creates a random number, write it down and assign it.