Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: Grid question
Thread ID: 209341 Message ID: 209440 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: General VFP Topics
Date: Sunday, December 28, 2008 10:10:17 PM         
   


> > Russel,
> > Saying key value I think it is indexed, then you could do like:
> >
> > =seek(the_key_value, 'myGridAlias', 'keyTag')
> >
> > However I would note soemthing else. Why are you dealing with substr() tricks, especially when you are not showing it. Instead you could use an SQL cursor as rowsource of your listbox. ie:
> >
> > RowSourceType: 3
> > RowSource:
> > select myDate, myName, myKey from myTable order by myDate, myName into cursor crsMyList
> > ColumnCount: 2
> > ColumnWidths: 75,100
> >
> > Then getting the key would be easier:
> >
the_key_value = crsMyList.myKey

> >
> > Furthermore if you use the same source instead of an SQL in listbox then you wouldn't need to do anything for the pointer, because as any selction is done in listbox, pointer would be automatically positioned on that record.
> >
> > Cetin Basoz
>
> Hi Cetin,
>
> My problem with your second suggestion is that the ListBox items are determined by variable tables.
>
> ie. Another ListBox click determines the table which is used to feed MyListBox.
> On one occasion it might be SELECT such_and_such FROM MyTable but on another ... FROM HisTable.
>
> Would I still be able to use SQL as RowSource in this situation?
>
> Thanks,
>
> Russell.

Yes you can create and assign SQL string on the fly.

Cetin Basoz

ENTIRE THREAD

Grid question Posted by Russell Hill @ 12/27/2008 1:41:45 PM
RE: Grid question Posted by tushar @ 12/27/2008 3:20:54 PM
RE: Grid question Posted by Russell Hill @ 12/27/2008 10:25:46 PM
RE: Grid question Posted by tushar @ 12/28/2008 9:54:42 AM
RE: Grid question Posted by Cetin Basoz @ 12/27/2008 4:25:33 PM
RE: Grid question Posted by Russell Hill @ 12/27/2008 10:24:09 PM
RE: Grid question Posted by Cetin Basoz @ 12/28/2008 10:10:17 PM