Normal Topic Populating a combo box (Read 451 times)
jchaney
Member
*
Offline


No personal text

Posts: 2
Joined: Feb 21st, 2005
Populating a combo box
Jul 20th, 2005 at 4:21pm
Print Post Print Post  
I am new to Sesame and very green to programming. I have a database that has a field called GroupName and I would like to have it function like the Company field in the SesameSeason.db, but I can’t seem to figure it out. I have the combo box but I can’t get it to list the existing GroupNames as options to choose from. Any help would be greatly appreciated.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Populating a combo box
Reply #1 - Jul 20th, 2005 at 4:44pm
Print Post Print Post  
Hello,

Below is some code that will help you accomplish this task. You will need to change the XListValues() call so it references the correct DB file and the correct Form name. You will also need to change the first argument of the PopulateListElement() call so it contains the name of the combo box you wish to populate with those choices.

Note: X Commands do not work in preview mode so you will need to reconcile in order to test this code.

Code
Select All
Var vGroups as String

vGroups = @XListValues(@FN, "FormName!GroupName")
vGroups = @SortstringArray(vGroups, 0)
vGroups = @UniqueStringArray(vGroups)
PopulateListElement(ComboBoxName, vGroups) 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged