Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IndexSeek
Message
 
 
À
31/07/2000 13:40:10
Steven Dyke
Safran Seats USA
Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00398890
Message ID:
00398896
Vues:
18
>I have a table with an index on a particular field. In a form I need the user to be able to change a customer order number field. After the text box is changed I want the table to be searched for any duplicate customer order and prevent this change if one exists. What I am trying to do is store the value upon gotfocus. When the lost focus fires the search is made. If the new number is already used restore the old value. The trouble I am having is when the search is false all the fields go gray. Because the record pointer is not on the right record. I need to use IndexSeek to do the search but I can not get it to work. It says it can't find my index tag. Please Help.

Create a parameterized view:

create sql view lv_check4dups as ;
select order_num from ordertable where ;
order_num = ?nOrder_Num

Then when you run your form, put that view in the DE with NoDataOnLoad set to TRUE. In the LostFocus:

local nOrder_Num = This.Value
requery('lv_check4dups')
if reccount('lv_check4dups') > 0 && that order_num already exists

I also recommend you do NOT use the same textbox that is bound to the current order number. Use a different textbox to enter the new order number and do NOT bind the textbox to any field.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform