Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unusual Error In Browse
Message
De
08/08/2002 10:09:51
Carmen Gassi
Perseus Software Systems
Oakville, Ontario, Canada
 
 
À
08/08/2002 08:33:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00687379
Message ID:
00687497
Vues:
13
Hi Gregory
Thanks for the tip, it worked well. I'm glad you decided to suggestit. Thanks again.

Regards,
Carmen
>>Hello All
>> I am currently setting up a filter in a table. The syntax for the filter command is as follows:
>> set filter to !ps_printed .and. ordno >= thisform.combo1.value .and. ordno <= thisform.combo2.value
>> I am filtering within a range of orders that the user would like to print, and I am only printed those where a packing slip has not yet been printed. The filter seems to be logical enough, and I can achieve the correct results when I issue the command in the command window. When I run the form, I get the following error "Object is not contained in a form". Needless to say, I am not able to debug this. I cannot seem to find where the error is, but the debugger does point to the browse command. I put the browse command in just to check to see if the data is being filtered properly, it (browse) will not be in the final application. Any thoughts?
>>
>>
>>Regards,
>>Carmen
>
>Carmen,
>
>Just to add to the others
>
>Never use variables directly in filter expressions. If you browse through (or move the record pointer in) the table, the Filter() is re-evaluated and hence the variables are accessed (like with thisform)
>
>If you need to use variables, use macro expressions
>
>eg (1) char fields
>
>namefrom = 'ca'
>nameto = 'da'
>
>local f
>f = [between(nameField, '] + namefrom + [', '] + nameto + [')]
>?f
>set filter to &f
>
>eg (2) num fields
>
>orderfrom = 33
>orderto = 99
>
>f = [between(ordno, ] + str(orderfrom) + [,] + str(orderto) + [)]
>?f
>set filter to &f
>
>iow, create a char expression that contains exactly the filter as if you would type it if you knew the values
>
>That way, once the filter is set, it contains no reference to the initial variable which (a) may not exist any more by then or (b) cannot be referenced like with the this/thisform scenario
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform