Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Suvi Joseph
  Where is Suvi Joseph?
 Bangalore
 India
 Suvi Joseph
 To: Travis Pick
  Where is Travis Pick?
 Waterloo
 Canada
 Travis Pick
 Tags
Subject: RE: The case of the disappearing right click event
Thread ID: 22122 Message ID: 22130 # Views: 1 # Ratings: 0
Version: Visual FoxPro 7 Category: General VFP Topics
Date: Thursday, April 10, 2003 6:55:48 AM         
   


> Well gang, I'm stumped.
>
> I have a grid, with 1 column. It has it's recordsource as a table in the data environment. The table in the data environment contains a list of fields from a chosen table. This chosen table is selected from a combo box. When a new table is selected from the combo box it runs the code below.
> The first running of the code works perfectly. As soon as a new table is selected from the combo box, it appears that all code set up in events and properties of the grid disappear. I noticed this because I used a messagebox to display the right click event. Normally it has code in it, but after choosing a second table from the combo box, the code disappears.
>
>
> Does anyone know why the code is "Reset" and how to stop it from resetting?
>
> Thanks
>
> Travis
>
>
> CLOSE DATABASES all
> OPEN DATABASE cp
> USE search EXCLUSIVE
> ZAP
> USE
> thisform.grdfields.recordsource = "" && grdfields is the grid on the form
> thisform.grdfields.RecordSourceType = 1
> 
> CLOSE DATABASES all
> OPEN DATABASE cp
> mytable = RTRIM(THISFORM.cmbTable.VALUE)
> SELECT 1
> USE &mytable ALIAS mytable
> THISFORM.cmbfield.ROWSOURCETYPE = 8
> THISFORM.cmbfield.ROWSOURCE = mytable
> 
> 
> SELECT objectname, riinfo FROM cp.dbc WHERE ParentID = (select objectID FROM cp.dbc WHERE objectname = (RTRIM(thisform.cmbtable.Value)) AND parentID = 1) into TABLE SearchTemp
> USE SearchTemp
> USE Search
> DELETE FROM Search WHERE objectname like "%%"
> APPEND FROM SearchTemp
> GOTO bottom
> GOTO top
> 
> 
> thisform.grdfields.RecordSourceType = 0
> thisform.grdfields.RecordSource = "Search"
> 
> 
> thisform.grdfields.refresh
> 

>
>
Hi,
Do you mean right click event of the grid? Right click event doesnt work if you dont have any record in the grid.
HTH.

Regards,
Suvi Joseph
www.sssoftwares.com


COMPLETE THREAD

The case of the disappearing right click event Posted by Travis Pick @ 4/9/2003 9:04:10 PM
RE: The case of the disappearing right click event Posted by Suvi Joseph @ 4/10/2003 6:55:48 AM