Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Make a List Box of All Queries to Select and Run

Status
Not open for further replies.

SuperG

Programmer
Mar 24, 2000
37
CA
How Do I Make a List Box of All Queries to Select and Run.

I've seen this done in access and my boss has asked me to create a similar list box without having to give access to the project viewer to the users.

Any ideas would help greatly.

Glenn
 
Check out the fileBrowserEx procedure in the ObjectPal Reference via the Help menu item.

HTH
 
FileBrowserEx would certainly help if you're saving your queries to disk and want to be able to quickly choose from a set of saved queries.

However, you might think about times when you might want a little more flexibility. For example, suppose you realize that you have three queries that are almost the same, except for a value that's being searched for.

For example, #1 returns a list of red cars, #2 gets a list of blue cars, and #3 fetches yellow.

In cases like this, you can actually save some time--and disk space--by creating a dialog box (from a form) that asks the user for the color they're interested and then returns a list of cars that matches that value.

It takes a little programming with ObjectPAL, but it's pretty painless in the long run.

For example, consider the following (which shows one way you might choose the colors):

Code:
var
   strColor String
   qryCars  Query
   tvAnswer TableView
endVar

   if fldColor.isBlank() then
      msgStop( "Can't Show Cars",
               "You need to enter a color." )
   else
      strColor = fldColor.value
      qryCars = query

         cars.db | color     |
           check | ~strColor |

      endQuery
      if qryCars.executeQBE() then
         tv.open( ":priv:answer" )
      endIf
   endIf

Some might call this a little simplistic, but if it's what you want, then who cares if it's simple?

The idea being to try to take some time and think about what you need your various queries to do and then come up with an easy way to autmate the work needed to run them. Paradox does that quite well, hoever, it does force you to come up with some of the initial ideas.

Hope this helps...

-- Lance
 

Check out enumFilelist
eg.
var
queries array[] string
fs filesystem
endvar
fs.enumFileList("*.qbe", queries)

creates an array with the names of all queries
you could use this in your forms open method to populate the list box.
HTH,
Richie

 
Thanks for the Help

I made one form for queries with variables like footpad recommended. And another one with a list box like ros mentioned for queries without variables.

Thanks A Lot and Have a Merry Christmas.

Glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top