AndrewMozley
Programmer
I would like to be able to detect certain keys when the user is entering data into a textbox in a grid.
This is so that I can perhaps insert extra rows into the underlying RecordSource of the grid; So I have included code in the KeyPress() event.
If however, I insert a normal character, such as ‘A’, the value in the underlying table is being duplicated on the screen and indeed in the underlying cursor. So a cell which had contained ‘Lands|cape’ then contains ‘LandsAAcape’
To try to track down the problem I have reduced the code of the text1.keypress() event to :
LPARAMETERS nKeyCode, nShiftAltCtrl
RETURN DODEFAULT(nKeyCode, nShiftAltCtrl)
(That is, I have omitted my code which took action to interpret certain characters). But the duplication of characters in the cell and in the underlying cursor persists.
By comparison, if I include such code in the KeyPress() event of a TextBox outside the grid, it all works fine.
Have I misunderstood the working of the DoDefault() call?
Thanks.
This is so that I can perhaps insert extra rows into the underlying RecordSource of the grid; So I have included code in the KeyPress() event.
If however, I insert a normal character, such as ‘A’, the value in the underlying table is being duplicated on the screen and indeed in the underlying cursor. So a cell which had contained ‘Lands|cape’ then contains ‘LandsAAcape’
To try to track down the problem I have reduced the code of the text1.keypress() event to :
LPARAMETERS nKeyCode, nShiftAltCtrl
RETURN DODEFAULT(nKeyCode, nShiftAltCtrl)
(That is, I have omitted my code which took action to interpret certain characters). But the duplication of characters in the cell and in the underlying cursor persists.
By comparison, if I include such code in the KeyPress() event of a TextBox outside the grid, it all works fine.
Have I misunderstood the working of the DoDefault() call?
Thanks.