Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IndexSeek
Message
 
 
To
31/07/2000 13:40:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00398890
Message ID:
00398896
Views:
25
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform