Thanks for Your Reply ..
Sorry I am not clear on my requirement in the above post .
I have a Graph.. User can see it by clicking on the button. But before clicking on the button the User should select the ItemNo. If the User Clicks on the button with out selecting the Item No. A Message should POP up that "Please select the Item No". If the User Selects the ItemNo and Clicks on the button the message should not display .
This is my requirement
You probably don't need a macro for that.
On the chart properties -> general tab. you can include a calculation condition like this:
=if( count(distinct ItemNo)=1,1,0)
Then, you include an error message to tell the user he should select something.
(on the same properties tab, click on error messages and include something at calculation condition unfulfilled)
Or you can include the same expression on the layout tab -> show conditional -> to hide the chart completely.
Hope it helps,
Yes, Erich approch is the best solution still i have tried achieving your scenario with out macro using variables but need too many variables and buttons.
Check this atatched app and my suggestion for you is follow Erich approch.
Test hide buttonm.qvw 149.5 K