My guess is that you don't want to do all of these things at once. Create a Login form that is opened at startup. Have an unbound control for UserId entry and a button to open your main form. In the click event of the button make sure that the user has entered a valid value in the UserId field. Hide the Login form (don't close it) and then open the main form. Then, anytime you need to use the logged in UserId refer to the control on the hidden form -
Forms!YourLoginFormName!YourUserIdControlName