Working with Combo

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Contact:

Working with Combo

Post by andy60 » Sun Jan 25, 2015 4:56 pm

hi, i'm using combo with a table with 2 fields ('idtype' and 'type'):

Code: Select all

global gConID

on mouseUp
   -- clear combo
   put "" into button "cboFilter"
   -- connect to database
   connectToDb
   --sql
   put "SELECT * FROM tbTypes" into tQuery
   -- execute sql
   put revDataFromQuery(,,gConID,tQuery) into tRecords
   -- handle error
   if tRecords begins with "revdberr" then 
      answer error "There was a problem accessing the people database: " & tRecords
      closeDB gConID
      exit to top
   end if
   -- close db
   closeDB gConID  
   -- insert datas in combo
   put tRecords into button "cboFilter"
end mouseUp
i have 2 questions:
1. how to insert all datas in combo with the only field 'type' visible?
2. how to recover the value of field 'idtype', after event combo 'clicked'?

thx for the help.
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Working with Combo

Post by Klaus » Sun Jan 25, 2015 6:36 pm

HI Andy,

sorry, do not understand what you are after!?
i'm using combo with a table with 2 fields ('idtype' and 'type'):
Do you mean a "combobox" type (menue) button?
And do you mean Livecode TEXT fields "idtype" etc.?
If yes they are not mentioned in your script.
1. how to insert all datas in combo with the only field 'type' visible?
Sorry, no capisce!?
2. how to recover the value of field 'idtype', after event combo 'clicked'?
Sorry, don't get this either? :(


Best

Klaus

andy60
Posts: 25
Joined: Sun Jan 18, 2015 6:51 pm
Contact:

Re: Working with Combo

Post by andy60 » Sun Jan 25, 2015 8:04 pm

@Klaus

hi Klaus, excuse for my bad english, i post a screenshot. I have a sqlite database with 2 tables: Contacts and Types.
Field idtype in table Contacts has relationship with field idtype in table Types. I'm testing LiveCode and the property of combos.

I want to populate combo with table Type. When i click and select value on combo i want to save in a variable the id of the record without show the id in the combo..

Thx for the help.
Attachments
combodemo.png
relation.png
Andy Bertini
Linux: Mint 17.1 Cinnamon - Gambas 3.6.2 - Gridbox 2.99.174 patched
Mac: OSX Yosemite - Livecode Community 7.0
Blog mzSoftware: http://crmforce.netsons.org/myzone
Email: and.bertini@gmail.com

Post Reply