Source language: Translate to:

Pick List

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Pick List

Postby Carl_SA » Sun Jan 20, 2008 4:54 am

I would like to get the pick list function to automatically retrieve the values from its own field.
e.g. the database field has a number of names in it. Is there a way that the picklist automatically populates and retrieves the list when I click on the field in the grid.
Carl_SA
 
Posts: 91
Joined: Sat Dec 17, 2005 12:47 am

Postby Gaev » Sun Jan 20, 2008 6:24 am

Carl_SA:

After you dbpOpenTable ... and before you dbpShowGrid ... use ...

dbpFieldToVar "database id" "table" "field" "[myCurrentValues]" "Delimiter=,;SkipBlanks=Yes;NoDuplicates=Yes"

... then do ...

dbpSetFieldProperties "database id" "table" "field" "PickList=[myCurrentValues];other properties"
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Carl_SA » Sun Jan 20, 2008 11:08 pm

Thanks Gaev,

I probably misunderstood the function. I was looking to get the user to refine a search by using a filter type function which was comprised of the value in the database field.
Carl_SA
 
Posts: 91
Joined: Sat Dec 17, 2005 12:47 am

Postby Gaev » Mon Jan 21, 2008 7:06 am

Carl_SA:

a) In the dbpShowGrid command, you can specify (in the properties parameter) ... OnDoubleClick=subroutine.

b) In your subroutine, you can ...

i) get the name of the field user selected with ... dbpGetActiveField

ii) then use ...

dbpFieldToVar "database id" "table" "field" "[myCurrentValues]" "Delimiter=,;SkipBlanks=Yes;NoDuplicates=Yes"


... where [myCurrentValues] are loaded into a standard ListBox/ComboBox ... from which user picks a value for the Query.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Carl_SA » Mon Jan 21, 2008 10:31 am

Great advice once again Gaev.
Carl_SA
 
Posts: 91
Joined: Sat Dec 17, 2005 12:47 am


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest