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

Grid Control SetFocus 1

Status
Not open for further replies.

omr1119

Programmer
Oct 7, 2003
34
PH
Hi,

I have A gridform.. Let say w/ 4 column or fields. In keypress event in column3 "Arrow down" the cursor should go to next record but in COLUMN1. Pls. see Condition below.

if nkyCode=24 and !eof()
skip
this.Column1.text1.setfocus
endif

...It has an error "Unknown member COLUMN1"
What should be the correct Syntax? or how the cursor will go to COLUMN1?

Thanks in advance.
omr1119:)



 
Hi ramani,

I'll try ur suggestion...

if nkyCode=24 and !eof()
skip
thisForm.GrdName_tmp.text1.setfocus
endif

no Error Occur but the cursor not pointing to column1, still in Column4.

if i used this command
this.parent.text1.setfocus
Program Error Unknown member COLUMN1.

is it possible to use setfocus in keypress event in a Grid?

Thanks,
OMR1119:)
 
Hi Ramani,

I Already did what you suggest, but still the cursor ramain in column4, i really confused what happen to my GridForm.

DODEFAULT()
if nkyCode=24 and !eof()
skip
thisForm.GrdName_tmp.Column1.text1.setfocus
endif

I'm still looking a way to trace to this problem!
If you have still another suggestion I really Appreciated.
Thanks for the Comment and time you gave!:)

OMR1119:)


 
HI

Sorry my suggestions were not tried by me and I was also in the same trap as you were.

1. Remove the code from your key press event.
2. Put the following code in your
Grid1.AfterRowColChange event..

IF nColIndex = 3 AND LASTKEY()=24
This.Column1.Text1.SetFocus()
endif
********************

There is no need to check for EOF() or do the SKIP, since a down arrow auto takes to next row..

The above code is tested and will work.
:)


ramani :)
(Subramanian.G)
 
Hi Ramani,

Sorry for the delayed response...
I've been having a hard time looking for this conversation i thought it's been deleted!
Until i use a keyword search in this Tek-tips.

I'll will work on it and give you feedback....

Thanks Again,

Omr1119:)
 
Hi Ramani,

It work's....

Thanks a lot...
OMR1119:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top