0

I'm creating a system that allows an individual to select module choices for their degree.

The users have to navigate between multiple forms (e.g. semester 1 & 2, user info, confirmation pages etc.). I want the users to be able to return to a previous form to make changes after progressing (i.e. return to semester 1 choices after moving onto semester 2 choices) and be able to still edit all the data they inputted into the first form.

I have tried using the hide and show methods but I keep getting an error (Run Time error '400' - Form already displayed, cannot show modally)

'on the AM1 form

AM2.Show

AM1.Hide
   '(first form I want to close)

'on the AM2 form

Unload me

AM1.Show
     '(I want to return to the first form and close the second)

I want to be hide the first form (AM1) and keep all the info available to be re-edited when successfully returning to it.

1
  • 1
    Just remove the second AM1.Show. You never hide AM1 it in the first place. Additionally you do not really use userforms in the right way as you seem to use the global default instance and are not aware of it. Commented Jan 2, 2019 at 17:04

1 Answer 1

1

Try hiding AM1 first before showing AM2 and that should fix your issue.

Private Sub CommandButton1_Click()
 UserForm1.Hide
 UserForm2.Show
End Sub

Also I think using the multipage control is probably better than using multiple userforms.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.