Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using multiple index on a file/cursor?
Message
From
16/08/1999 08:13:50
 
 
To
15/08/1999 17:26:02
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00253911
Message ID:
00253986
Views:
17
>I have a form that I need to be able to lookup a record from a different file (CLIENT) by 1 of 2 fields in the CLIENT file. The first, which works, is by CLIENT name which is selected from a combo. The combo is bound to the unique CLIENT id and is saved in the new file (LOG).
>
>The second way to locate the client is to key in a CLIENT number (different than the unique ID). I added a textbox to the form to allow possible input of the number. In processing the search of the matching CLIENT by number, I created a VALID method for the textbox and added this code....(the cbClient is the combo for the client name)...
>
>SELECT client
>Locate for client.clientnum=this.value
>if !Found()
> Messagebox("Client Number not found",48,"ERROR")
> return 0
>ELSE
> Thisform.pageframe1.page1.cbClient.Value=client.clientid
> return 1
>ENDIF
>
>
>
>
>I thought this would work and actually, it appears to be a hit or miss. By stepping through the code, the FOUND() returns a .T. even when a matching number is not found.
>
>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?
>
>Suggestions?

Look at a product called QBF Builder. It will let you search on multiple fields like you are trying to do. It is available here or from www.classycomponents.com.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform