>>>>I have this FPW2.6 form that had data entry boxes(textbox). If the user pressed F2 a list box would popup showing a selection which if selected would fill the value in the textbox and "Jump" to the next textbox. The code in the LISTBOX valid aften filling the field was:
>>>>
>>>>IF NOT EMPTY(txtdata1)
>>>> _CUROBJ = OBJNUM(m.txtdata1)+1
>>>> SHOW GETS
>>>>ENDIF
>>>>
>>>>This caused the focus to move to the NEXT text box in TAB order.
>>>>
>>>>I need to do something similar in VFP5 except the help is of no help.
>>>>_CUROBJ is not supported.
>>>>
>>>>How can I do this in vfp5. I need to make the focus move to the next txtbox in tab order from a form method. I can achieve this using KEYBOARD{DNARROW} but would prefer a better method.
>>>>
>>>>The form Method need not know the next textbox object name (like above in FPW26 OBJNUM(m.currentfield)+1).
>>>>
>>>>Thanks
>>>
>>>Use Control.SetFocus
>>
>>
>>I know aboutthe SETFOCUS Method. As mentioned above, I do not know WHAT "Control" is.
>>
>>In the FPW2.6 code I did not care as I used _CUROBJ = OBJNUM(currentfield)+1
>>This set the focus to the NEXT tab order field without the need of knowing what its name or variable was.
>>
>>THIS IS WHAT I NEED TO DO!!
>>
>>Bernard
>
>You have Form.ActiveControl property, Form.Controls() collection and Control.TabIndex property. And don't shout, please.
Edward
I tried all three commands and these are my findings. The only reason I am "bothering" you is that since you are an MVP you defnitely have more knoeledge of coding than me.
Ok. Form.ActiveControl - Only gives me the active control, not the next control to move to.
Form.Controls() - This gives me a number that is the order in which I added objects to the form and has no relation to the Tab order or position of the objects. So I cannot use this to find out the next tab object.
Control.Tabindex - This gives me the index number of the tab order.
What I need (now that I have tried these 3 commands) id the NAME of the control next in order of tab so I can SETFOCUS to it.
lease, what can do this for me.
(For me capitals are my form of emphasis like bold and not shouting!)
Thanks
Bernard