Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Kishore Kumar
  Where is Kishore Kumar?
 HYDERABAD
 India
 Kishore Kumar
 To: sudhir
  Where is sudhir?
 
 India
 sudhir
 Tags
Subject: RE: two tables in List
Thread ID: 188467 Message ID: 188889 # Views: 1 # Ratings: 0
Version: Visual FoxPro 5 Category: Forms
Date: Tuesday, August 12, 2008 12:43:00 PM         
   


> Dear Friends
>
> I want to show data from 2 tables in a listbox.
>
> What should i put in the ROWSOURCE to achieve this ?
>
> Thanks in advance
>
>
> Sudhir


Sudhir

If you wish to populate a list box with data from 2 tables; then a simple SQL can help you.

*-- in List1.Init
WITH This
.List1.RowSource = "SELECT a.col1, b.col1 FROM table1 a, table2 b WHERE a.key = b.key INTO CURSOR listing"
.List1.RowSourceType = 3
ENDWITH

*-- in List1.Destroy
USE IN SELECT('listing')

*-- if any changes made while data entry and want to refresh the list with lastest data then,
*-- in List1.Refresh
This.Requery

... very simple. try it.

- Kishore

ENTIRE THREAD

two tables in List Posted by sudhir @ 8/9/2008 10:31:44 PM
RE: two tables in List Posted by Eric den Doop @ 8/9/2008 10:35:36 PM
RE: two tables in List Posted by sudhir @ 8/9/2008 10:41:23 PM
RE: two tables in List Posted by Borislav Borissov @ 8/9/2008 10:53:33 PM
RE: two tables in List Posted by sudhir @ 8/9/2008 10:55:43 PM
RE: two tables in List Posted by Eric den Doop @ 8/9/2008 11:03:49 PM
RE: two tables in List Posted by Barbara Peisch @ 8/11/2008 11:04:31 PM
RE: two tables in List Posted by Kishore Kumar @ 8/12/2008 12:43:00 PM
RE: two tables in List Posted by Amol Pawar @ 8/12/2008 7:18:48 PM
RE: two tables in List Posted by Borislav Borissov @ 8/12/2008 7:21:04 PM