Text List Query Trouble

A Text List was built along the lines of the one shown in Text List Searching. As a name is typed, the list below updates very nicely with matches. It can also be toggled to search phonetically and does quite well with that too. When a name in the list is highlighted, that record is selected in the database. It all works; almost at 100%. But every so often when a line is highlighted, the list contents vanish and it start declaring that the variable used does not exist even though it did right up until the moment a line was highlighted.

Screen Shot 2021-07-14 at 1.16.32 PM

The procedure activated by a highlighting click on the list has no mention whatsoever of this variable but I added zlog lines to it and they show the variable as existing and bearing the right content.

Screen Shot 2021-07-14 at 1.17.08 PM

If I make any modification in the query box, the list reappears immediately.

So the only place it could be failing is in the List’s Query. There I have:
?(fgQSPhonetic = “”,import() contains fgQSearch,import() soundslike fgQSearch)

But again, this works nearly all the time so there must not be an issue in the formula. What would be causing the erroneous display and how can I eliminate it?

Let me start by saying I do not know what is causing this issue for you.

The only possibility that comes to mind is an issue with the scope of the variable. How is this variable defined? Is it defined only by the Text Editor object, or is there also code that defines it. If the latter, is there any possibility of a mismatch in the scope, for example fileglobal variable vs. windowglobal variable? Sometimes people wind up with two variables with the same name but different scopes, this will produce very confusing results if you are not aware that you have done this.

You should figure out the actual problem and fix it. But I also often set up formulas in graphic objects so that they never display an error, using catcherror(. So for example you could do this:

catcherror(false(),?(fgQSPhonetic = "",import() contains fgQSearch, import() soundslike fgQSearch)

I would think you might also want to set up your list to display all records if you haven’t typed in any search, like this:

catcherror("",fgQSearch)="" or catcherror(false(),?(fgQSPhonetic = "",import() contains fgQSearch, import() soundslike fgQSearch)

I have searched for other cases of the variable. It’s defined in Initialize as a FileGlobal and then only used with the Text List; in the Query formula and in the search entry box. The fact that it works and works, then fails is the concern.

I’ll add the catch error( .

I have run across a similar situation only involving a Popup Menu Button Object that will sometimes show the error message when clicked. It is a list of most recently used Payees in my checkbook database and is limited by the payee being used in the last 90 days since the current value of the Date field. The error says the Date field or variable does not exist even though it has a current value and has been used to enter the previous record a minute before. Clicking the popup button a second time brings the expected list of payees back up as normal. On one occasion it even then entered this error message into the next field (Debit) all by itself. This just happened to me again this morning when making entries.

Like James I checked and there are no other instances of Date being used as a variable.