The dash they're talking about refers to the CTRL+1 through CTRL+0 entries, which evidently return no value. F2 does in fact return -1, i.e., "minus one". Your code is OK. Put
Wait Window Nowait "You pressed F2" in there to check it. Also, refer to the KEYPREVIEW property which affects who gets the KeyPress event, the active control or the form.
>I saw that list, but it also says that if there is a dash (-) then that would me that key returns no value. This is the code I tried in the keypress event and nothing happened.
>
>IF INLIST(nKeyCode,-1)
> ThisForm.m_lookupid()
>ENDIF
>
>However, when I press the F2 key, nothing happens.
Rick Borup, MCSD
recursion (rE-kur'-shun) n.
see recursion.