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

problem with cursor positioning

Status
Not open for further replies.

Judi201

Technical User
Jul 2, 2005
315
US
Hi!

I have a form calling a modal form to get a number and check to see if valid and return to calling form. There I append blank, set values for the first three fields and refresh the screen. The cursor should hold on the fourth field but jumps to the nineth. I have checked tab order and any code in the fields and all seems right. All fields are bound to the table. I have tried SETFOCUS from many places. Is there any way that I can force the field to hold the cursor.

In debug, it initializes in the correct order, just doesn't stop. Any suggestion appreciated.

Thanks
Judi
 
Hi, guma2go,

Thanks for your response. I will look at your suggestion and see what I can do. Will post back.

Judi
 
guma2go,

If I understand what you are telling me, I have not seen any changes in behavior.

Just to make clear:

I am only replacig 3 fields and displaying the form for the user's input. The user should start entering on the fourth field and I can't make the cursor stop in the fourth field!

I tried SETFOCUS() in the LOSTFOCUS of the first field and nothing changed. I have tried SETFOCUS in so many places!!

The cursor still jumps 4 or 5 fields ahead.

Any one with a thought, please suggest for I would love to hear it. I have exhausted all ideas.

I set a breakpoint and follow the execution but I can't see anything wrong until the cursor just moves past the fourth field. I probably just don't know what to look for.
 
Hi Judi.

I've doing 2 forms (modal) and doing exactly codes

In First field txtnum1 so Your Number in Method Valid:
DO FORM num
* this what i think is Your validateform for num
SELECT ufo
APPEND BLANK
if __num_from_form_num#0
replace num1 with __num_from_form_num
endif
* this replace is only to a test that __num_.. is valid
REPLACE text1 WITH 'xxxx'
REPLACE text2 WITH 'xxxx2'
REPLACE text3 WITH 'xxxx3'
thisform.Refresh

And In this also First field in Method LostFocus
is only one line
thisform.txtNum4.SetFocus

And that works.
In this Form is no other Code.

Perhaps Have You to many Setfocus-es.
eg.
GotFocus Method in Field4 can setting other object
eg.
thisform.Refresh change to other database

So, try doing two new forms and test This.
Will be nice if this help You

Best Regards
George

 
George,
I do appreciate your response.

Perhaps Have You to many Setfocus-es.

I am wondering it that may not be the problem, but I haven't been able to catch it. I wish I knew how to trap for SETFOCUS . When I step through debug it hits SETFOCUS to the fourth field and highlights the fourth field but when it refreshes the screen and clears the debug screen it has moved. I will continue to try as I need to have this fixed by Monday if possible.

Judi
 
Hi Judi

That means Your Problem is in:

Thisform.Activate or in
Thisform.Refresh
or in Field4 in Methods Activate, or GotFocus

Best regards
Jerzy
 
George?, Jerzy?

There is no code in Thisform.Activate (either current or inherited); Cant' find method activate for field4. I have DODEFAULT set to interrupt inherited code in GotFocus

Judi
 
Hi Judi

George=Jerzy

Can You Delete Code (on a moment) from GotFocus???
and added Code
Wait Window "In GotFocus"
And eg Added Code to LostFocus
Wait Winow "Lost Auto"
That will be test what is going on.
And Without Debug You Can See what is.
If all will be auto that means - THisform.refresh have some extra code.
Because only logical is that this code Give the Motion to the other Fields.
or THisform.refresh is after Thisform.Field4.Setfocus.
In second Scenario Problem can be in THisform.refresh

 
Jerzy,

Yes, I can do that but before I do:

I think Refresh may be the culprit. Can you tell me this:
If I use Thisform.Thispgf.Thispag.Textbox.Refresh() will that have any effect on the cursor movement??

Judi
 
Judi

Quote:
Thisform.Thispgf.Thispag.Textbox.Refresh()

Where You wish to use this Refresh from your Field???
And For What???

For Your Answer
This method will be only refreshed This Field (field4) on Pagex in PageFrameY and nothing more (if it's default - so empty). But For what???

I think this is Your Input Field, Is Not ReadOnly and Enabled.
After Input, You can doing some code in Valid Method in text4 and than Refresh some objects or all page.

Best Regards
Jerzy


 
OK

I know that question does not make sense in this context but I do not want to use it here. I was checking its use in a method that is called in this page's refresh. I have a method keyed off these two fields on the page so they must be current before calling the method. As for the field being not readonly and enabled. They are by default but are set correct for this process of adding a new record. That part is correct because if I click on the field it responds as it should from then on.

So, this is what happens when I try your suggestions. It hits 'gotfocus' BEFORE the page is refreshed and hangs until it gets a mouseclick or keypress.
However the TAB on the page is highlighed as if I had clicked on it. This is different from before I made changes in the use of Thisform.Refresh(). Now it seems that once the fourth field gets focus and you click or tab, etc THEN the focus moves to the PAGE as tho I had clicked the BLANK AREA of the form, NOT a control.!

I have used Class Browser to search code for setting focus to the PAGE but found none that was suspect.
I really appreciate your time and effort in trying to help me.

Judi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top