I am trying to write some code that will add a command button to a userform, I am trying to achieve the following:-
Userform1 containing 1 button to close userform1
Userform2 containing 1 button to close userform2 and open userform1
Userform3 containing 1 button to close userform 3 and open useform1, but also to add another button to useform1 which will re-open userform3
Think that makes sense, I have tried various ways and got it working by adding code to the activate event off userform1 based on a varibale set by the button on userform3. This worked but I couldn't define any action for the button, if I added the code in the intialise event of userform1 the button did not get added. I tried repaint and put msgbox's in the code to check it was executing and everying seemed fine apart from the lack of any button.
Any ideas??
Cheers
Andy
Userform1 containing 1 button to close userform1
Userform2 containing 1 button to close userform2 and open userform1
Userform3 containing 1 button to close userform 3 and open useform1, but also to add another button to useform1 which will re-open userform3
Think that makes sense, I have tried various ways and got it working by adding code to the activate event off userform1 based on a varibale set by the button on userform3. This worked but I couldn't define any action for the button, if I added the code in the intialise event of userform1 the button did not get added. I tried repaint and put msgbox's in the code to check it was executing and everying seemed fine apart from the lack of any button.
Any ideas??
Cheers
Andy