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

Active control? 1

Status
Not open for further replies.

Judi201

Technical User
Jul 2, 2005
315
US
Hi,

This is a continuation of earlier thread on 'positioning cursor'.

Searching through other forums I ran across a suggestion to place this line where the cursor became 'lost'

Code:
 WAIT WINDOW Thisform.ActiveControl.Name

When I did this, I got an error message

ACTIVECONTROL is not an object.

Any ideas on where to go from here to find where my focus is.

As things stand now:

I call the modal form - get a valid number - return to the calling form - SetFocus on the fourth field in tab order (or any other field) and the cursor is lost. Clicking on a field will call it back and all is well but if the user does not click on a field before keying nothing happens, it is just hanging.

I will appreciate ANY thoughts.

Judi
 
Try this
Code:
m.loActiveControl = _SCREEN.ACTIVEFORM.ACTIVECONTROL
MESSAGEBOX(m.loActiveControl.name)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
Mike,
Yes, that gives me the name of a text field on page1 of the pageframe (instead of page3, where the focus should be). Now I have something to look for. I had tried the same line but not handled like that.

Thank you so much.

Judi
 
Hi!

Now I have a situation I really don't understand. If I show the message in Mike's code, the cursor stops in the right place When I click OK on the messagebox it is ready for data entry. If I comment out the messagebox it jumps ahead two fields. I am at my wits end.

Please, anyone, any suggestions?

Judi
 
Mike,

Tab order is set correctly and as you see I am trying to force a focus.

Code:
 *** got a new one - add record
      Thisform.ChkJob()   && get custno,partnumb
      SELECT orders
      APPEND BLANK
      REPLACE orders.jobsnumb WITH Thisform.NewJobno
      REPLACE orders.partnumb WITH Thisform.NewPartno
      REPLACE orders.custno   WITH Thisform.NewCustno
      Thisform.ShowOrdrScrap()
      Thisform.ShowProdStatus()
      SET ORDER TO TAG jobsordr
      Thisform.pgfCasting.pagOrders.Refresh()
      Thisform.pgfCasting.pagOrders.txtOrderno.SetFocus()

If I use your code to show the active control or if I step through in debug it holds on the fourth field. Remove either of these and it moves two field past.

Would the fact that the first three fields are readonly cause the cursor to move differently?

Thanks for any suggestions.

Judi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top