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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Would You Allow User To Skip Through Data With A Button On Form

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
I guess I'm looking for a way to allow a user to scroll through data on their form until they get near the data they wanted without using a grid- like scrolling thru names alphabetically.

The user wants to hold a button down without having to click once for each record. Kind of like a fast forward button. I'm replicating a Metafile program that allowed them to &quot;scroll&quot; thru records while holding the <Tab> key down and they would like to still be able to do this. Any ideas appreciated. Thanks.
The 2nd mouse gets the cheese.
 
Hello.

Try putting the code from Click Event in the MouseDown event. I presume that you should put a pause there, to cool down the scroll thing...

Hope this helps Grigore Dolghin
Class Software
Bucharest, Romania
 
I suggest keep a text box at the bottom of the grid search form. I have given a copy of the textbox - interactive change event which I use. I have used it as a part of my navigation button class. So the << < > >> buttons do exist along with the text seach textbox. I also do wildcard search for searhing contents of a field by using *.
The reading will give you an idea. This.Parent.Setme() does the navigation and focusing - set focus to grid and then set focus to the navigator - so that the grid line remains selected. I have set the grid line selected to have a distinct background color for highlighting.
***********************************************************
LOCAL cFilterOld, cFilterIn
cFilterOld = ThisForm.cFilterOld
cFilterIn = KEY()

SET FILTER TO

IF LEFT(This.Value,1) = &quot;*&quot;
IF LEN(ALLTRIM(This.Value)) > 1
ThisForm.cFilter = RIGHT(ALLTRIM(This.Value),LEN(ALLTRIM(This.Value))-1)
IF EMPTY(cFilterOld)
SET FILTER TO ThisForm.cFilter $ &cFilterIn
ELSE
SET FILTER TO &cFilterOld .AND. ThisForm.cFilter $ &cFilterIn
ENDIF
LOCATE
ELSE
IF !EMPTY(cFilterOld)
SET FILTER TO &cFilterOld
ENDIF
ENDIF
ELSE
IF !EMPTY(cFilterOld)
SET FILTER TO &cFilterOld
ENDIF
SEEK (ThisForm.cKeyPreFix + ALLT(This.Value))
ENDIF

This.Parent.Setme()
***********************************************************
The using of $ in the search makes the rushmore optimisation invalid. Beware of this if you are using very large database. For normal sizes, it works very fast.

You can also use LOCATE instead of SEEK if the situation warrants it.

Hope this helps you.
ramani :)
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top