TextList Query Question

I made a TextList for my garden database on my PlantDetail form and it works well using the search box.

I have a separate form which has buttons that I can click to filter the found set for a specific garden.

Here’s what I’m trying to accomplish:
When I click on a button for a specific garden, I want the TextList on the PlantDetails form to only show those plants in the selected garden. I don’t want to use the search box at all (I know how to delete this search box). I do have the Database Navigator selected. The DataView is closed.

The example shows that I selected the Front garden which has 9 plant varieties. The TextList continues to show all 227 plants.

Any help is greatly appreciated.

neonate, sometimes (I really need to do more form work so there is more “know”, and less “guess”), you need to refresh an object after making a change. Sometimes that happens automatically. Are you doing any kind of “Show” operation after your selection?

If it were me, I’d move the exercise out of your main database. Make a new database with records containing a fruit names - like apple, pear, orange, banana. Then create the same view object you are using for your garden database and add the same kind of selection control, except it selects for some fruit.

This way, all the other complexities of your garden database are removed and you can get up close and personal with this one operation without messing with the real deal.

I’m sure you - maybe with the help of comments from others here - will find a solution so your “test” case works. Then you just have to incorporate what you learned back in the Garden Database.

Isolating a problem/action from a more complex situation so you can focus just on it and not worry about real data and “reprogramming”, can be the shortest path to a solution. Or, at least, if the desired action works in the test enviroment, you’ll. know it’s not that action itself, but something else gumming up the works.

Great suggestion. I appreciate it.

I halfway did this. I made a new database to make sure I could get the TextList feature with search working. Then I replicated the in my garden database (actually, I duplicated my working database and used that). The thing I didn’t do with the test was to create a button to attempt to filter the TextList. Will give that a try.

Again, thank you.

If you want to set up the Text List to show a subset of the database, you have to set up the Query formula to do that.

You want to be able to change the Query formula with a button. That’s possible using the changeobject statement.

Actually since you just want to change the garden name, you could do it without the changeobject statement, you just need to have a fileglobal variable for the garden name. Set up this variable in your initialize procedure, something like this:

letfileglobal showingGarden = ""

Then in the Text List, use a query formula like this

Garden contains showingGarden or showingGarden=""

Then set up your buttons. The All Plants button should contain this:

letfileglobal showingGarden = ""
showvariables showingGarden

The Front button should contain this code:

letfileglobal showingGarden = "Front"
showvariables showingGarden

If you also wanted to be able to search within the selected garden, you could modify the Text List query formula to look like this:

(import() contains searchText) and (Garden contains showingGarden or showingGarden="")

So with this setup you could easily look for shrubs in the front garden, for example.


P.S. If I was doing this, I would consider coalesching all of the push buttons into a single popup menu button with a list of all the gardens. This would make it simpler to code and I think easier to use.

Thanks. I am going to try this.

Regarding the above: Do you mean like the “Star” on the Property Listings database on the PanX Database Exchange? Your suggestion seems better than what I did.

I really appreciate all of the help I’ve received on this forum. My garden database helps me with a hobby. I have a books database which also relates to a hobby. Everything I’ve learned (with the help of forum members) I’ll put to use in a more meaningful database (ie helpful to my family).

Thank you.

I’ve gotten everything working properly. I haven’t implemented the coalescing of the push buttons (I need to do more research before I can try this.)

Is there a way to automatically select the first record in a textList when changing to a new found set? ie - If the textList is showing all plants and I click a button to show only the Front garden in the textList, can it automatically select the first record? I have tried a few things but can’t find something that works.

There are several ways to make a pop-up in Panorama. The one I had in mind was actually using a popup button object, which would also automatically show you which option you had currently selected. But you could use the method used in the Propery Listing database as well.

Since you’re using the Database Navigator option, you would need the database to jump to that record using the find statement. For example something like this:

letfileglobal showingGarden = "Front"
showvariables showingGarden
find Garden contains "Front"

By the way, if you used the pop-up button method, you wouldn’t need the first two lines, the object would take care of that for you. The last line would still be needed, but you would use slightly different code, probably

find Garden contains showingGarden

Actually, that line of code would work either way.

Got this working using your example.

Will try to work on pop-up button method when I have time.

Thank you for your help.