Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help keeping table filter when calling modal form
Message
De
08/10/1999 06:30:59
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
07/10/1999 17:06:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00273967
Message ID:
00274113
Vues:
21
>I am working on application with 1 main form and and about 30 little input forms. The main form was created with a wizard, it displays the information for a Lab sample and a grid of child records that list the tests that were done to the sample and the reults. There is a 7 digit numeric field called samplid in each table that relates them. On the main form everything works well and updates fast with the buttons(top, next, bottom..) Here is the problem - There is a menu with lots of test choices that can be run. Each one displays a small modal form. There are a couple of input edit boxes and a save button and a close button. This part is very slow. I was hoping the modal form would already be filtered to the sampleid displayed on the main form but it is not. I have written code to do this but I know there must be a better, faster way. After doing the input a calculation is done and a new record is added or if an existing record is found it is edited. The tables are called
>sample and samprslt. samprslt has 3 fields and is indexed on sampleid, testid, and sampleid+ testid.
>I thought something like this would work:
>select samprslt
>locate for testid = 4 &&there is an index on testid
>if found()
> m_FeCl2 = result &&result is a field name
> m_Found = .T.
>else
> m_FeCl2 = 0
>endif
>
>Instead I use this, which works but is very slow (2500000 records)
>DoDefault()
>m_Found = .F.
>select sample
>m_ID = sampleID
>thisform.lblSampleid.caption = str(m_ID)
>select samprslt
>count to mycount
>set filter to sampleid = m_ID
>set order to testid
>locate for testid = 4
>if found()
> m_FeCl2 = result
> m_Found = .T.
>else
> m_FeCl2 = 0
>endif
>thisform.lblcalc.caption = str(m_FeCl2) Thanks for any suggestions.
>Gary


I don't want to start a discussion so accept this as my personal opinion. Filters even if they were optimized are slow.
Instead :
-I would have parent and child tables in DE.
-Set relation to child
-Seek parent id.
-In child I would set key to testid
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform