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

Need to capture value of Grid1.column1.text1 on Click

Status
Not open for further replies.

GellyBelly

Technical User
Aug 29, 2002
52
US
I want to click on a grid cell and capture the associated value to a variable. How would I do that?

I will subsequently use the variable in a query.

Thanks,

Gerry
 
Gerry,

The value of a grid's cell is the value of the corresponding field in the underlying table or cursor.

So, suppose the grid's RecordSource points to MyTable, and the third column in the grid is the Address field in MyTable. When you click in the third column in a given row, the contents of the cell will be the same as the current contents of MyTable.Address.

Hope that makes sense.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Try this (not tested):
Code:
**** Grid AfterRowColChange  Event

LPARAMETERS nColIndex
WAIT WINDOW EVALUATE(this.Columns(nColIndex).ControlSource)

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
Microsoft MVP VFP
 
Thanks Mike,

After some frustration, I discovered I mistakenly closed the table before assigning the value. Thanks for setting me straight!

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top