I.T. Discussion Community!
-Collapse +Expand
Paradox
Search Paradox Group:

Advanced
-Collapse +Expand Paradox To/From
To/FromCODEGuides
-Collapse +Expand Paradox Store
PRESTWOODSTORE

Prestwood eMagazine

October Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyCorel Paradox / ObjectPAL Coding BoardParadox Forms Topic   Print This     

Populating drop down from a table

Populating drop down from a table in Paradox Forms topic (part of our Corel Paradox / ObjectPAL Coding group).

Quick Search: Populating   Populating drop   Populating drop down  
Ash.B2
Melville, -- --

Hopefully you aren‘t getting too sick of me!

I‘m hoping to auto populate a dropdown menu from a table column, and have the dropdown update when I change the original table (through a different spot in the application)

I currently have several drop down menus, which I populated at the time I created them using the "Expert" from a column in a lookup table.  Problem is, when I update the lookup table, the dropdown menus don‘t update.  They are static.  I would like them to be dynamic and auto updating.

I tried using a method I saw here: http://www.prestwoodboards.com/ASPSuite/KB/Document_View.asp?QID=100208

I placed the variable tcCatFilterList  TCursor in the var method for the field

I placed the self.dataSource = "[Table.Field]" in the Arrive section of the List

I placed the code for populating the dropdown in the CanDepart section of the Field

    if not self.isBlank() then
        tcCatFilterList.open("PartCategory.DB")
            if not tcCatFilterList.locate("Category", self.value) then
                tcCatFilterList.edit()
            tcCatFilterList.nextRecord()
                tcCatFilterList.insertRecord()
                tcCatFilterList."Category" = self.value
                tcCatFilterList.(1) = tcCatFilterList.cMax("Category") + 1
                tcCatFilterList.postRecord()

            endIf
        tcCatFilterList.close() ;Not needed, but good form.
    endIf

The problem being that I only get one item in the dropdown menu,  which happens to correspond to the selected record.  No other records populate.  (The idea is to select a category from the dropdown and then pushbutton to filter the table by that category.)  So if I‘m on a part that falls into the Engine category I cannot filter by Cooling System, since only Engine shows up in the drop down to select.

The lookup table in question only has one column, btw. 

When I tried a different filter using a different table that has 2 columns, one name, one numeric (The name column being the primary index), I end up with the same problem.

How can I get the entire list to populate?

 Posted 9 months ago (Thread Starter)
Comment Quote
About Ash.B2 -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #17832, 5 replies
Thread Started 1/23/2020 6:31:45 PM
View Counter=389
Last Reply Posted 2/25/2020 12:49:26 PM)
Location=Melville, -- -- 
Joined=12 months ago   MB Posts=17  
Moderator
Steven.G
Myrtle Beach, SC USA

the built-in lookup help won't do that.. there are a number of ways to "filter" the results by building your own lookup help

Steven Green
Senior Software Engineer
Paradox Support Specialist DOS/WIN

Prestwood IT Solutions
8421 Auburn Blvd, Suite 256, Citrus Heights, CA 95610
Office: 916-726-5675 | Fax: 916-726-5676 | http://www.prestwood.com
 Posted 9 months ago
Comment Quote
About Steven.G -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #17849 (Level 2) and Parent is 17832
Reply Posted 1/29/2020 4:47:17 PM
Location=Myrtle Beach, SC USA 
Joined=49 months ago   MB Posts=404  
Ash.B2
Melville, -- --

Thanks Steven.  Any articles or tutorials you can recommend as a starting point?

 Posted 8 months ago (Thread Starter)
Comment Quote
About Ash.B2 -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #17859 (Level 3) and Parent is 17832
Reply Posted 2/5/2020 9:33:24 AM
Location=Melville, -- -- 
Joined=12 months ago   MB Posts=17  
Moderator
Steven.G
Myrtle Beach, SC USA

offhand, no.. so much depends on your context and level of knowledge

a simple idea might be to use a pop up form, that you CAN filter, then pass back the selected lookup value

Steven Green
Senior Software Engineer
Paradox Support Specialist DOS/WIN

Prestwood IT Solutions
8421 Auburn Blvd, Suite 256, Citrus Heights, CA 95610
Office: 916-726-5675 | Fax: 916-726-5676 | http://www.prestwood.com
 Posted 8 months ago
Comment Quote
About Steven.G -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #17861 (Level 4) and Parent is 17832
Reply Posted 2/5/2020 9:55:11 AM
Location=Myrtle Beach, SC USA 
Joined=49 months ago   MB Posts=404  
rum
Frankfort, KY USA

I am not sure if I understand your complete requirements.  However,  I use the following to fulfill what I think is a similar situation


The following method is attached to the cbobox.list object.

Then loadlist is called from wherever I want a refresh to happen.

I am doing a few extra things here so by way of explaination...

my Combobox is called   "cboDef"
the list attached to cboDef is named "defList"

arrDefName  &  arrDefFiles  are arrays that I am storing additional data in.  Since a combo will only show one data element,   I store additinal elements that i want to reference in arrays that have the same index as the combo list.

method loadlist()
var
qbeList Query ;// tmp handle to query
tcList TCursor
si SmallInt
nm String
nmInt String
LIFile String
endVar

qbeList =
Query

SORT: imexDefHeader.DB->"LayoutDescription"
imexDefHeader.DB | ID |LayoutDescription |LastImportFile |
| CheckPlus | CheckPlus |CheckPlus |

endQuery


arrDefName.Empty()
arrDefFiles.Empty()

;// Make sure correct lang driver is used
;//
tcList.open("imexDefHeader.DB")
qbeList.setLanguageDriver(tcList.getLanguageDriver())
tcList.close()

if NOT qbeList.executeQBE(tcList) then
errorShow()
return
endIf

;// Fill the list from the cursor
;//
si = 0
self.list.count = si
scan tcList :
  nmint = String(tcList."ID")
  nm = tcList."LayoutDescription"
  arrDefName[nmint] = nm

  LIFile = String(tcList."LastImportFile")
  arrDefFiles[nmint] = LIFile

  si = si + 1
  self.list.selection = si
  self.list.value = tcList."LayoutDescription"
endScan

tclist.close()
endMethod

 Posted 8 months ago
Comment Quote
About rum -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread with a verified email.
Member pending approval.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #17862 (Level 5) and Parent is 17832
Reply Posted 2/5/2020 12:11:33 PM
Location=Frankfort, KY USA 
Joined=40 months ago   MB Posts=122  
Most Recent Post
Ash.B2
Melville, -- --

Thanks so much, Rum!

I took your code and refined it to my purposed.  No arrays for me, so I was able to simplify it, and in the end it wound up working better than I actually had planned!  (Was able to sort just by selecting the drop-down menu item, didn't need a separate button, like I thought I would)

This worked very well, and I thank you.

Ash

 Posted 8 months ago (Thread Starter)
Comment Quote
About Ash.B2 -Collapse +Expand
Visit Profile
Membership pending.
Member subscribes to this thread with a verified email.
Old Account!
If this is your account, sign in to activate web presence data (sign in quarterly to keep active). Alternatively, you can subscribe to our monthly eMag with a valid email address.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #17918 (Level 6) and Parent is 17832
Reply Posted 2/25/2020 12:47:49 PM
Location=Melville, -- -- 
Joined=12 months ago   MB Posts=17  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1262A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #17832 Counter
389
Since 1/23/2020

Follow PrestwoodBoards on: 


©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech