Hello to all,
I like to write some code to refresh a grid after moving the cursor.
I have a form with some textboxes and a grid that shows all records of the table. Also I have a toolbar with buttons for SKIP -1 and SKIP 1. After a SKIP I like to move the record pointer at the correct position in the grid, and after that the focus must be at the actual textbox:
[tt]
ThisForm.Grid1.SetFocus()
ThisForm.Textbox1.SetFocus()
[/tt]
Now my problem is, that I like to have this code in my toolbar-buttons, but I didn't know how to keep the actual textbox that has the focus.
I can use:
[tt]
lcActiveFocus=thisform.ActiveControl.Name+".SetFocus()"
ThisForm.Grid1.SetFocus()
ThisForm.&lcActiveFocus
[/tt]
But I like to have code that works also, when the textbox is on a page of a pageframe or in a container. Then my code won't work
Does anyone have a better idea without writing hundred lines of code? I know, I could check the parent property of the active control, but perhaps there's a better way.
Georg Nickel
Software Development
Germany
I like to write some code to refresh a grid after moving the cursor.
I have a form with some textboxes and a grid that shows all records of the table. Also I have a toolbar with buttons for SKIP -1 and SKIP 1. After a SKIP I like to move the record pointer at the correct position in the grid, and after that the focus must be at the actual textbox:
[tt]
ThisForm.Grid1.SetFocus()
ThisForm.Textbox1.SetFocus()
[/tt]
Now my problem is, that I like to have this code in my toolbar-buttons, but I didn't know how to keep the actual textbox that has the focus.
I can use:
[tt]
lcActiveFocus=thisform.ActiveControl.Name+".SetFocus()"
ThisForm.Grid1.SetFocus()
ThisForm.&lcActiveFocus
[/tt]
But I like to have code that works also, when the textbox is on a page of a pageframe or in a container. Then my code won't work
Does anyone have a better idea without writing hundred lines of code? I know, I could check the parent property of the active control, but perhaps there's a better way.
Georg Nickel
Software Development
Germany