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

Incremental Search in Grid

Status
Not open for further replies.

omr1119

Programmer
Oct 7, 2003
34
0
0
PH
Hi to all Tip Master's,

Need Help... using Vfp6.0
i have using incremental search in Grid by "Ramani".
i make a project and put this in application.
let's call it "top2.exe"
when i run this application....
it's work and the code was doing fine...

When i call "top2.exe" From main programs let's
say "main.exe" "main Programs" -
the "top2.exe" not work properly. "under main.exe"

under "interactive changes" and valid event from top2.exe....

error accurs like this.
error : 2002 cannot call SetFocus from within a When, Valid,
RangeLow Event. Line 33 in FORM1.TEXT2INTERACTIVECHANGE

Under line 33 is
Thisform.GrdMygrid.Setfocus


Any Idea.
Thanks in Advance :)
omr / vfp6
 
1. an explanation of error message:
You can't call Setfocus from within a Valid event. This doesn't work, because the return value of the valid event determines, where the focus will go (or stay). Comparable reasons go for When event.

2. I wonder why you call an exe from an exe, if it's all your source code, you can and should put it together in one project. You may also DO ...fxp IN "someother.exe", unfortunately not DO FORM, but you may call a prg/fxp that itself DOes the FORM.

3. Maybe try SET CONFIRM ON, so that the search textbox does not loose focus by typing in too much text and only looses focus when [TAB]bing or with [RETURN].

Maybe you post some code here to better describe your problem...

Bye, Olaf.

 
hi olaf,

1. i just wonder why my application top2.exe and the code by ramani run perfectly "using top2.exe"....
when i run this under main.exe have this problem...

2.exe from an exe... it has an advantage to me..
ex: main.exe = 5 applications.....
production.exe
hrd.exe
qa.exe
query.exe
top2.exe
if i want to upgrade or debug in TOp2.exe
user's from production,hrd,qa & query are no need to
exit the application .... only user's using top2.exe...
in that way only several user's are need inform to exit the programs other's can continue what they need to finished on that day...

3. set confirm on is activated....


thxs. for the replay

..here's the source code by ramani...

*** under InteractiveChange ***
&& sele cmic_tmp
&& set order to tag matr_no
LOCAL cFilterOld, cFilterIn
cFilterOld = ThisForm.cFilterOld
cFilterIn = KEY()

SET FILTER TO

IF LEFT(This.Value,1) = "*"
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 ALLT(This.Value)
ENDIF

ThisForm.Refresh()
ThisForm.grdCmic_tmp.SetFocus
This.SetFocus

thxs. again
OMR :)
 
Hi omr,

Well, I found the faq from ramani. There is additional code for the grid, but most probably that's not the point.

Hmm, I can't help you much. If top2.exe runs as a standalone exe, it should also run called from main.exe, as it's another process, has it's own environment settings etc. it's totally independent of main.exe.

Or what do you do, how do you call top2.exe from main.exe?

Bye, Olaf.
 
Hi Olaf,

i'm still trying to solved the problem until now....
that is the reason why i confused it's run standalone "exe"...
it supposed to run under main.exe
w/o any prob.

...i will trace it one by one in every form
or i'll try to use this code in main.exe
before going to top2.exe.. "to trace the error"

...Anyway...
thank you very much for your time.
omr[peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top