Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database ...select

Status
Not open for further replies.

NeilMFC

Technical User
May 20, 2004
4
GB
Hi

I would liek to make a field were it can be searchable. If you do the ...select command it makes a huge list. However i have a list of over 50 items so i do not want a drop down menu. I want to be able to say type COV in the field pressa key like F9 and for it to automacally go to Coventry and allow me to scroll up and down.

Is this possible

Thanks in advance
 
I'm not sure I follow. Are you trying to search for part of a word, like "cov" in "coventry"? If so, there are a couple ways to do this.

One is to use BEGINS. This will find all records where the field begins with whatever you want, such as "cov".
FOR EACH table NO-LOCK
WHERE table.field BEGINS "cov":

Another is MATCHES. This matches a pattern and you can use wildcards. "cov*" will find all records where the field begins with "cov", similar to BEGINS. "*cov" will find all records where the field ends in "cov". "*cov*" will find all records where the field has "cov" anywhere in the value.
FOR EACH table NO-LOCK
WHERE table.field MATCHES("*cov*"):

If you know the value in the field will always begin with "cov", then BEGINS would be better to use as it has better performance.

Hope that helps!

Rich
 
Not sure if this is exactly what i ment.

With our old case management system, we are able to type say cov and press F9 this then allow us into the field to search through using F7 to go back and f8 to go through the list. If you have an e mail address i can show you screen shots of what with have.

Thanks Neil
 
If I'm reading this correctly, you want to be able to initiate a search at any randomly selected starting point, then have the ability to scroll forward or backward from there. Progress has the ability to do this, but it takes some effort programatically. It is easy enough to start at a select location and go in a single direction (up or down), but it takes on another dimension when you try to go in both directions. It is certainly not a simple little 'go to record beginning COV and start scrolling either direction'.

If you're well schooled in programming, look at building your own 'workfile', middling your start key, indexing your screen pages, then showing them a page at a time allowing user selectable direction control (key-up, key-down, 'f'orward, 'b'ackward, 'p'revious, 'n'ext, whatever). See, it gets to be pretty intricate. If you haven't a clue what was just said, I'd suggest finding a programmer type who really likes to dig in, bunker down, and do some heavy duty looping logic. What you're wanting can be achieved, but my guess has it that the person who wrote the code you're patterning this after, spent plenty of long, hard, hours making those 'f7', 'f9', function keys do what they do.

Good Luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top