Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
Subject: RE: Relation, filter and List index
Thread ID: 96726 Message ID: 96756 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Tuesday, May 23, 2006 3:43:38 PM         
   



> Use accbal2 in 0 orde code
> set filt to iden = "cuac" and dltd = " "
>
> Use Nwdc in 0 orde code
>
> Select Nwdc
> Set Relation to code into accbal2
>
> I am Editing a record from table Nwdc I have to take account name from accbal2 table in a combo box whose Rowsourcetype=6
>
> Store Accbal2.accna to Thisform.Combo1.Value
>
> Here automatcially value assign to listindex is 7 but record position in table is 10 this is all due to filter on table when i remove filter it assing the correct listindex value
>
> How can i manage this listindex value in edition of record with filter options on table


Let me see if I have your question right. You have 2 tables open. The first one (accbal2) contains a name. The second table (nwdc) contains some other data that you are editing. (I assume that this is a header/detail construct.) When you move to a record in nwdc, the relationship between accbal2 and nwdc will automatically select the correct accbal2 record where the name is attached. Now you have a combobox that will hold names and you want the appropriate name to be selected.

The first question I would have is "Why use a combo?" Do you wish to change it? If so, use your Names table as the rowsource for your combo and then
IF NOT SEEK(accbal2.name,[NamesTbl],[NameTag])
   MESSAGEBOX("Name does not exist")
ENDIF


If you do not wish to change the name, then all you need do is display it in a text box using AccBal2.Name as the control source. Don't use a combo.

Ken

ENTIRE THREAD

Relation, filter and List index Posted by Khurram Tahir @ 5/23/2006 9:10:00 AM
RE: Relation, filter and List index Posted by Ken Murphy @ 5/23/2006 3:43:38 PM
RE: Relation, filter and List index Posted by Khurram Tahir @ 5/24/2006 7:32:43 AM
RE: Relation, filter and List index Posted by tushar @ 5/24/2006 5:05:26 PM
RE: Relation, filter and List index Posted by Ken Murphy @ 5/24/2006 5:21:11 PM