Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using multiple index on a file/cursor?
Message
From
15/08/1999 18:20:42
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
To
15/08/1999 17:47:39
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00253911
Message ID:
00253916
Views:
19
Hi Mike,

I originally used the the LOSTFOCUS method, then in the process switched to the VALID because I was doing things actually a bit different. When the user skips the field (blank or null) I was going to ignore the search... if the user inputs a number, it HAS to be a valid number so I was going to keep them in the field - most likely blanking it out after the invalidity.

I actually got the code to work - sort of - I had the txtbox control source set for CLIENT.CLIENTNUM. This seemed to be the item that was throwing the LOCATE off. I ended up removing the CONTROL SOURCE and of course then I had to play with the VAL of the value because it immediately converted input to a string.

If I keep it this way, I have to modify the REFRESH on the CLIENT combo so that the txtbox gets refreshed with the appropriate value when the user selects from the combo OR use the forms NEXT/PREV keys. This brought up an interesting point... because the value is a string now, when I move to the field to change it, the original string still shows if I don't physically delete it... example 12345 when I move back to the field and type a 8 let's say, I get 82345. Is there a way to cause the field to clear when you type for the first time in the field? Might make user input a bit easier and quicker.

Still not sure if this is the best way to do all this or not but if I can get it to work, that will be fine.

>Hi Peter,
>
>>I also tried to use the index for the CLIENT number and a SEEK() but when I tried to add a SET INDEX TO CLIENTNUM I got an error about table/cursor buffering which through me. (I still need to work on the buffering stuff for this app... right now everything is set for the defaults)
>>
>>Is there a way to have more than one INDEX available at a time on a form? Would I add multiple instances of the file in the DE and set the ORDER property differently or something similar?
>
>I think this might help you:
>
>
>SELECT Clients
>lcOldOrder=ORDER() && or set('order') to save the current order
>SET ORDER TO CLIENTNUM
>IF SEEK(This.Value)
>  *You found it
>ELSE
>  *You didn't so display your message box
>ENDIF
>SET ORDER TO (lcOldOrder) &&Restore your order
To be honest, I'm not sure if what your doing is a good method. If the user tabs to the TextBox and doesn't know any order number, there is no way to leave and the user is trapped. You should put your code in somplace other than the valid ( a search button or lostfocus, so the user can leave or return at will) or maybe another combobox with incremental search enabled?
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform