Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
hopkinsc
Partner - Specialist III
Partner - Specialist III

clearing fields when chart is maximised?

Hi, can someone tell me how i can automatically clear any date selections when the user maximises a specific chart?

My date fields are :

Cal_Year

Cal_Week

Cal_Period

StoreDate

And the chart i want to maximise is

CH04

I am assuming i would use a trigger, but unsure on which one to use...

Thanks

4 Replies
nagaiank
Specialist III
Specialist III

When you are in the sheet having the chart object CH04,

Go to Settings -> Sheet Properties

Then go to Triggers tab

You can set triggers for 'OnActivate' and/or 'OnDeactivate' events of any sheet object.

Hope this helps.

christian77
Partner - Specialist
Partner - Specialist

Hi:

1st -----You can clear manually.

2nd -----You can use a button. Add the action Maximize the object and the action Clear All to the button.

“Document Properties” contains triggers about sheets, general, etc.

“Sheet Properties” contains triggers about objects. Properties about objects are when activating, and deactivating the object.

I didn´t see any trigger when maximizing or restoring.

3rd ------But, you may want to use a macro. I´m sure is possible.

Sub whatever

set c=ActiveDocument.GetSheetObject("CH01")

if c.IsMaximized then

ActiveDocument.ClearAll

else

end if

end sub

3 solutions in one

Have a nice weekend.

hopkinsc
Partner - Specialist III
Partner - Specialist III
Author

Hi, thanks. I only want to clear my date fields, but when i select

ONACTIVATE>> CLEAR OTHER FIELDS>> and add StoreDate into the field box, it doesn't work.

CLEAR ALL works, but i don't want to clear ALL of the selections...

christian77
Partner - Specialist
Partner - Specialist

Hi:

Find APIGuide.qvw in your documentation.

ActiveDocument.Fields("Class").Clear

ActiveDocument.Fields("Class").ClearAllButThis

ActiveDocument.Fields("DateField").Select ""

Ok.