PopUp on form opening w blank value. Culprit found. Solution?

I think I found the culprit for the non-working PopUp issue. But the solution is WAY above my skill level.

Not a really critical issue for me, but I suspect others may encounter this down the line, where it might be a somewhat important issue.

Briefly, Extracted a few months of data, created a new pared down DB, one simple form, .Initialize with Global variable. Same result. Tested multiple times. Also closed and reopened Pan in the process. And of course, saved each time. And after first use, PopUp works just fine from then on.

And I’m hoping someone else can re-create and confirm this. Or maybe it’s simply my error. Whatever.

In summary, here is what appears to me, is the underlying issue. The Date field is set correctly, but when the DB is initialized, the Date field is missing its name, datatype (resets to Choices!!) and output pattern. As mentioned, tested and repeatable.

Note: Global variable value and variable formula on form display properly on opening. But the PopUp doesn’t. Duh!!

Screenshot below, and PopUp snippet and .Initialize. Is it me…or some phantom gremlin at work??

Global myMonth
//Field Date
myMonth = datepattern(Date, "Month YYYY")
OpenForm "Form_X"
showvariables myMonth
If myMonth = “June 2026”
select exportcell(«Date») match “06/*/26”
endif
showvariables myMonth


I don’t understand your screen shot. First of all, it seems to show that your field has no name. Also, it seems to show that your Date field has a type of Choices. I would expect it to have a type of Date.

A possible point of confusion is that by default, objects in forms create and access fileglobal variables, not global variables. It’s possible to switch this preference, but since you didn’t mention doing this I suspect that you didn’t do that. In any case, I don’t recommend doing this, it’s almost always best to use fileglobal variables. In fact, I would recommend to never use a global variable unless you have a very specific reason for doing so.

Anyway, since you are mixing global and fileglobal variables with the same name, that is probably the source of your problem. You’re creating a global variable, but the object is not seeing that variable, and is creating a separate fileglobal value with the same name.

Opening a form in an .Initialize procedure is no longer a recommended practice. Instead, you should use the Panorama feature designed to do this for you.

Your code for selecting based on the myMonth variable is going to require a separate if statement for every possible month. Instead, I would suggest this code, which will work for any month.

select datepattern(Date,"Month YYYY") match myMonth

If I understand correctly, you want the database to open and automatically select only records in the the same month as the currently selected record. Here’s how you would write the .Iniitalize code for this:

letfileglobal myMonth = datepattern(Date, "Month YYYY")
showvariables myMonth
select datepattern(Date,"Month YYYY") match myMonth

You haven’t mentioned how you are creating the list of months for your popup menu. I would suggest using the summarytable( function for this. Add this line to the top of your .Initialize code

letfileglobal monthChoices =
    arrayrange(summarytable("groups",{groupdatepattern(Date,"Month YYYY")}),1,-2,cr())

Then you can use the monthChoices variable in the PopUp menu object. Or, you could skip this variable and just put the formula into the popup menu object directly.

You could also possibly create this list with arraybuild( and arraydeduplicate( but that would not put the months into the correct calendar order (instead they would be alphabetized).

Jim:
Apologies if I didn’t make things clearer. The Date field WAS set properly — fieldname, datatype, pattern –– each time I closed the DB and reopened it. My point was that after opening, everything changed to blank filename, choice type, and no pattern. Also, after opening, even though filename, datatype, pattern were empty or wrong, the PopUp acted as it should. It chose the months correctly.

You had mentioned in your response to my previous question on the topic that perhaps I needed to make it global. So I tried it to see if the PopUp would retain its value after close and reopen. Back in my Pan 6 days I never used globals anyway, only local and fileglobals, so this was new.

Yes, I am using a separate IF stmt for each month. And your suggestion on “select / match” makes much more sense. And your .Initialize code too. (Gotta get up to date on things. Been gone too long.)

As far as list of months in the PopUp goes, using “July 2026, June 2026, May 2026,” etc. in the PopUp formula panel. Summarytable( is new, just looked it up. Bingo. Makes more sense, and a LOT less typing. Had also seen the section on Window Arrangement some time back, but obviously didn’t absorb it. Got a lot to learn and re-learn here. And thank you for taking time and effort for the lesson!

NOW, for the kicker here. My diagnosis of the “culprit” here is totally wrong! Date (& TransactonDate previously) going blank on filename, datatype, etc, as in the screenshot, has NO bearing on much of anything. Just discovered this after posting. As I said, the PopUp works fine regardless.

In this case, I moved the Date field to the right to see if it would repeat when the field was in a different position. Nope! After moving Date field to the right, the field in position 1 in the DB was a TEXT field. And guess what. Fieldname disappears, datatype became Choices, etc. after invoking the PopUp. Here’s the funny part: If I moved the cursor to another field and then back to the 1st field, the text field, the datatype again returned to its proper type – text ! Also very repeatable, at least in my case. Strange behavior, but things nonetheless work as they should. Check and see if you get the same result.

The PopUp is still blank when opening the form, but it works properly when invoked. So I’m going to check out your suggestions on this and sooner or later I’ll get this fixed. For me, it’s more cosmetic than essential since it works as it should. So for now, for me, this question is moot. As far as I’m concerned, this topic here could/should be deleted. Too many pixels and too much eyeball time wasted cluttering up the list.

Thanks again. Back to lurking and working.

The Date field WAS set properly — fieldname, datatype, pattern –– each time I closed the DB and reopened it. My point was that after opening, everything changed to blank filename, choice type, and no pattern.

I think you are running into a known bug that if the first thing you do after opening a database is open the Field Properties panel, the data in the panel doesn’t update properly. Simply clicking on another field and then back again displays the proper data. This is a stubborn bug that has resisted significant attempts at resolving it. Note that it is purely a cosmetic issue, the field actually has the correct properties, they just don’t display properly in this one situation.

I should have recognized this earlier, but I was distracted by the pop-up menu question, which is entirely separate from this.

You had mentioned in your response to my previous question on the topic that perhaps I needed to make it global.

I don’t think I did mention global variables. I mentioned the possibility of making it a permanent variable, which is completely different from a global. In fact, a permanent variable is actually a fileglobal variable that is saved with the database.


By the way, Michael, I definitely remember you from when you were a Panorama user years ago. My recollection is that you made some very nice looking detailed databases. Glad to welcome you back to the fold again after all this time.

Jim:
One final note. And these observations are prompted both by your mention of the aggregate( and summarytable( functions, and the new initial windows feature, and also by my own searches in the Forum, and the Pan help file documentation, etc. I recently stumbled on the category “NEW” in the help file. I had been looking for something like this for a while. I knew it probably existed, but where?

And I also know that many of the more familiar (and less familiar) long time expert Pan heads on the list have been building some very sophisticated Panorama implementations over the years. But what are they, what do they do, what do they look like? How could others implement similar Pan solutions in their environments? The cadre of developers and current users know, but who else?

(Yeah, I also know there are 41 entries in the DB exchange and it’s gonna take me a while to download and deconstruct those to see how things work. That will come later.)

But the above two observations, combined with my sales & marketing, advertising and media background are what prompt these comments. All of that sales & marketing background was before discovering Panorama. Prior to that discovery I lived in the PC world. I had some PC retailer clients, and played a bit w VB & Access (never a power user by any means). This was in the late DOS / Win 3 era, and I was also on the BOD of the local PC User Group, and ran the Internet SIG there. ) Had a fast frac T-1 and worked with a couple of local ISP start-ups, on content & marketing, not programming. At some point, I bought a used Apple and used Aldus and Adobe apps and got hooked on what they could do. Then I discovered Panorama in the late Pan 3 period, and thought, “Wow, this is cool, I might be able to make this work, too”.

All of this brings me to my point here with two simple suggestions. One is easy, the other will take some more thought and planning to implement.

FIRST: Rename that “NEW” category to, say, “NEW in Panorama X” and move it up higher in the index hierarchy, maybe just after the Tutorial listing. Include 4 sub-topics: 1) New Functions, 2) New Statements, 3) Depreciated statements & functions, 4) Known Bugs. (Seeing the latter would have saved me a couple of hours frustration and everybody’s wasted eyeball time resulting from this current thread about “finding the culprit”.)

SECOND: Start a YouTube channel, something like “Panorama X Under the Hood”, or whatever. Doing so is free or relatively cheap, but will take some thought and planning. It could include some of your existing training videos that are on Provue.com and, of course, point to some of the paid video training.

More importantly, it should showcase what some of the pro developers here are doing, and equally important, how. For instance, Jim Cook, Ameeti, and many others could show what their apps do, and offer a demonstration and explanation of how the apps were built, some of the programming considerations, and some of the code. For example, a health care application could take 3 or 4 (or more!) videos covering different aspect of the app –– 10, 20, 30, 40 minutes, or whatever, and how and why they work. And a whole series on the Pan network environment could be especially relevant in promoting Panorama. I think you get the idea.

Why is that important? Not only could it further help educate and inspire some relatively low level users like me to stretch out a bit and try new things, but more importantly it could help reach a lot of potential new users, a new generation of Pan heads. Maybe some younger high-skill Gen Z Pan geek/influencer types could get involved with something like this and, in effect, help “sell” Panorama to that new generation of potential Pan users. Maybe find a “Pan Evangelist” somewhere to spread the word. (Remember Guy Kawasaki? Great salesman!)

As a sales & marketing type from the beginning, I tend to see a lot of things from that perspective. That’s where I’m coming from here. (When you morph into a hammer, you tend to see nails all around that need pounding.)

Two key principles here: In the simplest terms, marketing is about finding and identifying your potential customers. Advertising is about creating awareness of your product or service to that target market –– and then creating urgent brand desire! It’s just that simple. (Though implementation may not be, and generally isn’t.)

In today’s environment creating and delivering content through various channels is going to be key to continued future success. (Maybe Panorama X on “X”, BlueSky, etc, TikTok, Instagram….?? Just a thought.)

Hopefully the above suggestions could help not only further educate the current user base, but also help a bit to address the dual paradigm of marketing and advertising for the future of Panorama. But I’ve ranted long enough on this track. Over and out. Now back to work.