Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, February 23, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Populate ComboBox based on Table
SLX_Novice
Posts: 246
 
Populate ComboBox based on TableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jul 11 12:44 PM
fiogf49gjkf0d

Hi all.


We are using SLX LAN v7.2.1


 


We have a table myTableA with a field "Division". I want to be able to load the distinct values in the "Division" field in myTableA in a combobox (cmbDivision). Any idea how I can do this?


I could always hard code it:


cmbDivision.Items.Add("Retail")


cmbDivision.Items.Add("Government")


etc. but I would always need to update the code whenever a new division was added to the table.


 


Thank you in advance.

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Populate ComboBox based on TableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jul 11 1:07 PM
fiogf49gjkf0d

Simple, query the DB:


'Assumption: adCon = ADODB.Connection object and adRec = ADODB.Recordset object. adCon has already been initialized and opened


Set adRec = adCon.Execute("select distinct division from TABLE")


Do While not adRec.EOF


  cmdDivision.Items.add(adRec(0).Value & "")


  adRec.MoveNext


Loop

[Reply][Quote]
SLX_Novice
Posts: 246
 
Re: Populate ComboBox based on TableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jul 11 1:18 PM
fiogf49gjkf0d

Great thanks Raul!


 

[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/23/2025 7:08:32 PM