Hello,
OK, I'm still not getting the significance of _activeform.keypress(). Are you saying to open my form in design mode, open the properties box, go into the KeyPress Event and create a [User Procedure] there that contains the code?
Thanks for your continued help. Chuck
>Hello,
>
>Okay, try it with cleaner 'coding' lol... I did apologise in a later message...
>
>In the _activeform.keypress() Event you would have the code:
>
>PRE
>IF TYPE("THISFORM.ActiveControl") == "O" AND UPPER(THISFORM.ActiveControl.BaseClass) <> "GRID"
> IF INLIST(LAST(), leftarrow, rightarrow... leftclick...)
> chucks_keypressevent()
> ENDIF
>ENDIF
>/PRE
>
>The "O" means we are on an object, just a habit I got in of insuring everything works...
>
>HTH
>
>Ric
>
>>>>Hi Chuck,
>>>>
>>>>You will need code in your textbox's KeyPress event to accomplist what you want. FWIW, I would put the code in the grid (or the form) and reference the same code from both the Click() and the Keypress()
>>>>
>>>>pamela
>>>
>>>Hiya Chuck, Pamela;
>>>
>>>What if you have 30 something columns on the grid? Perhaps if you do it this way...
>>>
>>>_activeform.keypress
>>>
>>>/pIF TYPE("THISFORM.ActiveControl") == "O" AND UPPER(THISFORM.ActiveControl.BaseClass) <> "GRID"
>>> IF INLIST(LAST(), leftarrow, rightarrow... leftclick...)
>>> pamelasnewformmethod()
>>> ENDIF
>>> ENDIF
>>>ENDIF /p
>>>
>>>Of course, this would only allow for one grid. If you had to, you could explicitly name it...
>>>
>>>IF TYPE("THISFORM.ActiveControl") == "O" AND UPPER(THISFORM.ActiveControl.BaseClass) <> "GRID" .AND. THISFORM.ActiveControl.Name = mygridname
>>>
>>>Just a thought...
>>>
>>>Ric
>>
>>Hi Ric,
>>
>>I do like the idea of not having to code all the txtBoxes in the grid. However, I've never used code before like what you are proposing.
>>
>>Where does the line _activeform.keypress go?
>>
>>What does the == "O" mean in the line IF TYPE("ThisForm.ActiveControl") == "O"
>>
>>TIA, Chuck
Chuck Henry