PopupMenu and ComboBox filling from text file at open time

I actually “populate” PopupMenu(s) and ComboBox at window Open time from sqlite files.
I also set their values from Texts files to display datas from the sqlite file.

Not Clear ? I restate it for, say, a ComboBox:
I have a “Charity Association” (CA) sqlite data base. I use it to populate the ComboBox using the names of the CA. WHe a CA is selected, the ComboBox populates a serie of COntrols with properties like name, address, phone #, contact name, etc.
But: if I type the name of the CA, I get its complete name and a Return populates the Controls.

Then, I display in a Window data from elsewhere (Text file) and place the CA name in the ComboBox.

Unfortunately, this does not populates the Controls with the CA details (address, Phone, Contact Name #, etc.).

What do I miss ?

The return? You are not triggering the event?

How can I do that by code ?

When selecting the ComboBox (or PopupMenu), and typing text, you have to press Return (or Enter) to activate the Control (fire it).
But this part is working. I mention it to avoid answer asking if I do that and if it works.

For a PushButton, there is .Push to activate it on code. I do not found the same kind of command for ComboBox or PopupMenu.

Ideas ?

Emile, since you know what name you are putting into the Combobox, and the Combobox requires action on the part of the user (a Return to “accept” the info) perhaps you will need to retrieve the other data and populate the other fields from the same routine you are in when putting the name into the Combobox.

Dale:

Thanks for the idea. Simple, but I do not think at it, shame on me :wink:

Before doing that, I will try to add a Return (EndOfLine) appended to the string I put in the ComboBox / PopupMenu. WHo knows, it may be simply that after all.

I forgot to explain why I do not use .ListIndex (or is it .Index ?):

as of today, I know what 1 means (Charity Association, CA), but the client can add (or remove) one or more entries (CA). So, Index / ListIndex 1 is CA a, but it can be CA 2 by tomorrow !

BTW: I checked (adding an EndOfLine at the end of the entry, but the only result is… an EndOfLine at the end of the Text Property !

I think Dale idea is the good one…

Hi Dale,

Thank you for your advice: I implemented it and it seems to works with my simple testings data (so it will certainly works when data will be in working situation: much more entries than right now).

This tooks time (as everything), but now it is OK:

a. the ComboBox: used for new Record and Modify Record,
b. the Populated with data from the .sqlite file (I use the Charity Association name to get the RecordSet / Record data).