Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
One-to-many search problem
Message
 
To
28/03/1998 13:33:33
Ken Mears
Calif Dept of Fish & Game
Sacramento, California, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00087743
Message ID:
00088164
Views:
32
>>>I am attempting to build a form with fields from Table A (One record per individual) and a grid from Table B (Many records per individual). I do not use the wizard to build the form, but have modified the txtbtns class from the wizstyle library to allow for three search conditions instead of two. I would like to be able to search fields from both tables when using the find button. If the DataEnvironment of the form contains both tables, only the fields from Table A are displayed in the dropdown list of the combobox, allowing only searching of Table A. If the DataEnvironment of the form contains a View built from Table A & Table B, the dropdown list in the combobox behaves the way I wish, but the form behaves as if there are as many occurrences of the record in Table A as there are child records in Table B. If there are three matching records in the grid, I must click "Next" three times before the next Table A record appears on the form. I know there must be a way of doing this, and
>>I'm
>>>just to thick to see it. Any tips appreciated.Thanks.
>>>Ken
>>
>>
>>Open the DE, right-click on a blank spot and choose properties. Find the Parent-child cursors and set the 1-to-many property to false.
>
>Jerry
>Thanks for the tip. That takes care of the duplicate parent. Now if I can just beat this child search thing... Over the years I find I have become an unofficial support person and help desk. I 'used to be' an analyst and a programmer. I am telecommuting one day a week now and I'm slowly getting back into it. Thanks again.

The child seek thing is easy!
Index all the fields in the child table that you want to search on.
Then, in the code, somethink like
IF SEEK(txtSearch.Value,'ChildTable','indexname')
    Temp = ChildTable.ForeignKey
    =SEEK(Temp,'ParentTable','PrimaryKey')
ENDIF
ThisForm.Refresh()


Jerry
Nebraska Dept of Revenue
Previous
Reply
Map
View

Click here to load this message in the networking platform