Pop up button to be blank after use

Hello friends,
I have a Pop Up Button with about 8 different choices. I can make the selection just fine. The problem is that I want it to go away after returning to the form. I don’t want that item “Discount Listing” to be selected.

When a choice is made, the value is placed in a variable. In your screen shot the variable content is “Discount Listing”. Once you’re done with the choice, reset the variable to a default value. I typically use a title on popups to identify it.

In Panorama X, the value must be part of the menu formula, so list it as the first of your menu’s choices and have your procedure written to do nothing if the title is chosen.

You can have the variable containing the selection reset to “” using a Form Event Procedure in the Properties Panel. Here is a screen shot of that panel with some sample code I used to reset the theSelection variable for the popup menu.

Now whenever the form is brought to the front that variable will reset to “”.

Hi Gary,
Thanks for the response. I must admit I have never used the Form Event Procedure.
No matter what I do I get a warning "Unknown Statement: Form

The formFRONT I showed in my example is a special label for Form Events to indicate that the following code is to be executed when the form is brought to the front. It is not used to indicate the current form name as you have used. Note that the label must match exactly including case. So, only use formFRONT as the label

This is covered at the end of this help topic under Form Event Procedures.

Hi again Gary,
I have it typed exactly as you have outlined and I still get the "Unknown statement: Form

You are showing a different variable in the showvariables line (theselection instead of theSelection). This assumes your data selection is set to a variable named theSelectiion.

Thanks Gary. That did it. Did I tell you I was old?

No excuse - probably not as old as I am.

I think using the Form Event feature here is overly complicated. Why not just put this code into the code that is triggered by the popup menu?

Better yet, I would look at my suggestion earlier today about not using a PopupButtonObject for commands, instead using the popupclick statement.