Source language: Translate to:

query to list box?

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

query to list box?

Postby yanzco » Wed Sep 24, 2014 7:26 am

if i type a query to a table..
ex. chicken

i wanted to have a button that when i clicked, shows a list box, containing all results query.

like this..
------------------v
chicken a
chicken b
chicken c
etc
etc

then if a selection is made..

it is clicked also on the table.. ( active record )


another turn around i thought was..

make a hidden db table..
then when the button is clicked..
it shows the table with the query search..

then gives me the query results to choose from..
when clicked.. the object table hides and the active record is selected?

or maybe double click is better suited to do the table hide when clicked..
yanzco
 
Posts: 178
Joined: Sun Jul 20, 2014 4:07 am

Re: query to list box?

Postby Gaev » Wed Sep 24, 2014 7:51 am

yanzco:

i wanted to have a button that when i clicked, shows a list box, containing all results query.

like this..
------------------v
chicken a
chicken b
chicken c
etc
etc

Take a look in the Help file to see how dbpFieldToVar works ... take particular note of ...
If you plan on displaying the data in a List or Combo box, you should use a carriage return as your delimiter. In NeoBook a carriage return is entered as "[#13]".



then if a selection is made..
it is clicked also on the table.. ( active record )

You could ...

- either loop through the current set of records (using dbpFirst and dbpNext) ... and check the selection (e.g. "chicken c") against the actual field values ... when found, exit the Loop.

- or do another dbpQuery using the selected content ... you will get a grid with just the matching record(s)


another turn around i thought was..

make a hidden db table..
then when the button is clicked..
it shows the table with the query search..

then gives me the query results to choose from..
when clicked.. the object table hides and the active record is selected?

Why use two Tables ? ... just do a dbpQuery for (say) "chicken" ... you will see all matching records ... click on the one you want and it becomes the current record.
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest

cron