Hello All,
I have a complex workbook with an userform that I call the "control panel". This userform contains various aids for data entry. The form as multiple pages that correspond to data fields on several of the worksheets in the workbook.
I have been performing some minor changes ... mostly cosmetic. In the latest iteration of making some updates the command buttons on the userform pages other than the home page, have stopped working. Not entirely actually, but now when the user clicks the command button, instead of running the macro, once clicked, the userform immediately opens the home page of the userform and the macro quits. If I go back to the page by clicking on the page tab and click the command button again, it then will run the macro as expected.
Does anyone have any ideas on what may have happened here. I did not change the macro nor the layout on the userform.
Here are some images of what is happening ...
Here is the user form when first opened ... defaults to Page 0
I click on "User Controls" button to go to this page ...
I have several command buttons. When I click on any of them, the userform immediately reverts to another page. In this case (buttons on this page), it reverts back to the home page. If I re-open the User Controls page and click on a command button, then it does what is expected.
Using the "Refresh Worksheets" command button as an example, here is the code associated with that command button ...
Here are the properties for the page in question ...
And here are properties for the base user form ...
I am stumped.
Steve
I have a complex workbook with an userform that I call the "control panel". This userform contains various aids for data entry. The form as multiple pages that correspond to data fields on several of the worksheets in the workbook.
I have been performing some minor changes ... mostly cosmetic. In the latest iteration of making some updates the command buttons on the userform pages other than the home page, have stopped working. Not entirely actually, but now when the user clicks the command button, instead of running the macro, once clicked, the userform immediately opens the home page of the userform and the macro quits. If I go back to the page by clicking on the page tab and click the command button again, it then will run the macro as expected.
Does anyone have any ideas on what may have happened here. I did not change the macro nor the layout on the userform.
Here are some images of what is happening ...
Here is the user form when first opened ... defaults to Page 0
I click on "User Controls" button to go to this page ...
I have several command buttons. When I click on any of them, the userform immediately reverts to another page. In this case (buttons on this page), it reverts back to the home page. If I re-open the User Controls page and click on a command button, then it does what is expected.
Using the "Refresh Worksheets" command button as an example, here is the code associated with that command button ...
VBA Code:
Private Sub refreshbutton_Click()
msg = Sheet5.Range("data_refresh_message_text").Value
Style = vbOKCancel + vbDefaultButton2
Title = "Data Refresh"
response = MsgBox(msg, Style, Title)
If response = vbCancel Then Exit Sub
Application.Run ("refresh_worksheets")
End Sub
Here are the properties for the page in question ...
And here are properties for the base user form ...
I am stumped.
Steve