Article View: alt.lang.basic
Article #266Re: VBDOS questions for MS guys
From: Steven Podradchik
Date: Wed, 07 Oct 1992 19:21
Date: Wed, 07 Oct 1992 19:21
29 lines
1690 bytes
1690 bytes
In article <droland.921006185344@lab18.eng.auburn.edu> droland@eng.auburn.edu (David A. Roland) writes: >Thanks for the info on everything. Do I get a prize or anything for >finding that SENDKEYS wasn't in there? You get my sincere thanks. At least my mother thinks that this is a prize to be valued above all else :) >Let me ask one other question, I was using SENDKEYS to send a TAB everytime >the user hit ENTER so that on data entry you could whiz through forms. >Without it I have to set the focus to the next textbox in order. I tried >having the keypress event do something like this > if keyascii=13 then keyascii=9 >but this doesn't work any other way that is that simple? Not sure, off hand, how to simulate SendKeys to do this but there is another way that's really simpler anyway. Simply set up your text boxes as a control array. Then your code would be something like: Sub txtDataEntry_KeyPress (Index as Integer, KeyAscii as integer) if KeyAscii = 13 then if Index < MaxFields then 'the # of text boxes on your form txtDataEntry(Index+1).SetFocus end if end if end sub This method works fine in vb/win and vb/dos and is somewhat 'cleaner' than using SendKeys. Thanks, Steve
Technical Details
Message-ID:
<1992Oct07.192124.1834@microsoft.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!microsoft!wingnut!stevepoReferences:
<droland.921005113717@lab18.eng.auburn.edu> <1992Oct06.192108.391@microsoft.com> <droland.921006185344@lab18.eng.auburn.edu>Show Full Headers
Complete Article Headers
Newsgroups: alt.lang.basic Path: arc1-ca.pugleaf.net!sparky!uunet!microsoft!wingnut!stevepo From: stevepo@microsoft.com (Steven Podradchik) Subject: Re: VBDOS questions for MS guys Message-ID: <1992Oct07.192124.1834@microsoft.com> Date: 07 Oct 92 19:21:24 GMT Organization: Microsoft Corporation References: <droland.921005113717@lab18.eng.auburn.edu> <1992Oct06.192108.391@microsoft.com> <droland.921006185344@lab18.eng.auburn.edu> Distribution: usa Lines: 31