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

Creating a popup window from a grid that opens and closes when changing rows

Status
Not open for further replies.

CCHSR

Programmer
Aug 3, 2005
15
US
VPF 6.0
I have a grid that when I change rows it passes data to varables that I pass to a form that I want to pop up
each time I change rows, I am having trouble finding the right procedure to accomplish that.
The form I call looks up some detail about some items and shows that info in a grid (does not have to be grid can
be something else that shows about 1 to 5 data records).
At the moment I am triggering it using afterrowcolchange, but not sure how to close the form and open again.
Hoping someone has run across this before.

Regards
Craig C. Hudson Sr.
 
Many possibilities.

Starting the record form, you may also use click of any column control or have a column with an edit button.

Controlling the record form, DO FORM NAME oRecordForm and you can close it with oRecordForm.Release, besides NAME also see LINKED clause of DO FORM. Also you may use a form class, which you start with oForm = CreateObject("formclass"), inevitable to have a form reference you can work on programmatically. Besides you may not use a form and simply have a container visible/invisible.

Bye, Olaf.
 
Another possibility:

Only open the form the first time you need it. After that, instead of opening and closing it, you toggle its visibility. That will be quicker than constantly opening and closing it, and will also be smoother from the user's point of view.

So, the first time you need the form:
[tt]
DO FORM MyForm WITH <parameters, if any> NAME oForm[/tt]

To make it visible:

[tt]oForm.Visible = .T.[/tt]

and to make it invisible:

[tt]oForm.Visible = .F.[/tt]

This assumes that the variable oForm is in scope all the time. If necessary, make it a custom property of the main form.

Now, having said all that, I wonder if displaying the information in a separate form is the best way to go. I would prefer to have a single form, with the details shown below or next to the grid. If there is no detail data to show, you can toggle the visibility of the individual controls.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top