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

Indexing on an expression

Status
Not open for further replies.

Samalia

Technical User
Jun 7, 2005
46
0
0
CA
I have two tables that are linked upon a stocid, which in the child table is one field, and in the parent table it is 5 fields, account, nursery, seedlot, type and age.
When I navigate through a form that has the parent on top and the child in a grid it had no problem navigating through both tables. But when I try to search for a specific record in the child table the corresponding record is not found in the parent table. I've tried forcing it to find the correct stocid but it has not done so for me. Any help would be appreciated.

- Samalia
 
Samalia,

How do you generate the index key for the parent table?

In any event, you'd probably find it easier to maintain if you used a single primary key for that table, preferably something like an autoincrementing integer.

Regards,
Jim
 
Samalia,

when I try to search for a specific record in the child table the corresponding record is not found in the parent table.

How are you doing the search?

In general, there's no reason why searching for a child record will move the record pointer in the parent record. You need to write code explicitly to do that.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
When searching for the stocid in the parent table I'm first searching for a different record in the child table, then I copy the child table's stocid to a variable cstocid and then search for that in the parent table. I've tried searching the index on the parent table and even searching all the fields together to match the cstocid variable but each time I get a no find.

- Samalia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top