Share via

Userform not working

Anonymous
2014-06-26T14:33:42+00:00

I have created this userform and cannot figure out where my error is. I have another userform (let's call it userform1) and it has a "Development Mode" Command Button on it. When You press the Development Mode Command Button, this form comes up. If you enter the correct user name and password, it does exactly what I want it to do (closes all userforms and allows access to VB). When a user presses exit, I want this userform to close and userform1 to remain active. I have tried the following:

This one causes an error when I try to show userform1

Private Sub cmdExit_Click()

    Me.Hide

   userform1.Show

End Sub

This one unloads BOTH userforms

Private Sub cmdExit_Click()

    Unload Me

End Sub

Any suggestions????

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. OssieMac 48,001 Reputation points Volunteer Moderator
    2014-06-27T07:01:56+00:00

    When I test I am able to simply close the password form with the Exit button using just Unload Me and the other Userform remains open.

    I am thinking that maybe you are using some other code to unlock the VBA project and this might be interfering with it. I would like to know exactly what is occurring with your code so would you like to share the rest of the code you have for opening both forms and any other code you have for the Exit.

    Was this answer helpful?

    0 comments No comments