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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change properties of USE ? window

Status
Not open for further replies.

Rich196

Programmer
May 17, 2003
42
US
I am using a query form similar to makesql in the solutions database in VFP8. The "Use table" button click event is :
THIS.parent.cmdClear.click
THIS.parent.choosetable
choosetable opens a window by issuing USE ? and some of the properties such as ICON and the choice of tables and views I would like to change.

Is this possible?
Thanks,
Rich
 

Not sure what you mean. Do you mean something like this (where you can configure what the dialogbox says) :
Code:
lcFile = GETFILE('dbf',"Please select a table","Open table",1)
Use (lcFile) alias myTable shared again in 0

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Actually, I do want them to be able to choose a view but not have the option to choose a table. They are then able to choose the fields and dynamically build the SQL to execute with the RUN button.

The USE dialog box which displays when USE ? is entered in the command window is what is being used in the choosetable procedure in the sample. It's the properties of that dialog box I want to be able to change.

I hope this is a little clearer.

Tahnks,
Rich
 
Rich,
Why are your user's using the VFP command window? Isn't this expensive to buy a developer copy of VFP for each user?

Why not write a program to just provide what they need? With a little code (and some publically available routines) you could then control what they can chose.

Rick
 
My users aren't using the command window. I only used that analogy because the code that I am using from the from the solutions sample uses the same command (USE ?) that can be entered in the command window. That way you could see what I am talking about.

The MAKESQL form in the solutions sample has a USE TABLE button that has
THIS.parent.cmdClear.click
THIS.parent.choosetable
in the click method.
Choostable then has as the first command USE ?.

I just can't see a way to change the properties of the USE dialog box?
 
Hi Rich,

What Mike and Marcia are getting at is that "USE ?" and GETFILE() use the same Open Dialog. The GETFILE() version allows you to specify options.

Actually, I do want them to be able to choose a view but not have the option to choose a table. They are then able to choose the fields and dynamically build the SQL to execute with the RUN button.

This, I don't get, views AFAIK are contained within a dbc and aren't standalone files.

Regards,

Mike
 
In the end, it would be much easier, and actually possible, to do what you want if you were to abandon the idea of using the open dialog...I mean if you want your users to choose from a set of views and then be able to choose fields to include from those views you are going to have to build your own UI to accomplish this...think of a combobox with a list of view names in it and then a grid beneath that that will display the fields for a given view that has been selected in the combobox. The grid has a checkbox in the first column and the name of the field in the second column...the user goes through the grid and checks the ones they want...or perhaps a couple of listboxes side-by-side with some mover controls between them and maybe even a little drag-n-drop functionality for selecting the fields they want...there are a few other options depending on your needs but I think I've given the general outline for accomplishing what you want.

Just for the record, it maybe a lot easier to just shell out a few dollars and get a royalty free copy of a good query maker tool to handle this. They usually allow you to define data dictionaries where you can include the views and relationships you want...and then the rest of the functionality is provided for running these queries and even for creating reports and such. It may be the softest and easiest way to go about this, unless you are creating a commercial query maker/reporting tool, in which case this wouldn't be an option.

boyd.gif

 
Thanks for all the replies and help. I really appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top