Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make *something* happen when Return key is hit

Status
Not open for further replies.

KennyUK

Technical User
Sep 13, 2001
38
0
0
GB
Hi gang,


I am using MS Access 2000 - I need to have an event happen when a user has typed data into a text box called txtCore on a form called form called frmEvents and hit the return key, for example:

User enters txtCore - types something - hits the return key - My event is triggered.

I have been reading in the help files about KeyDown, KeyUp Events and KeyPress Events together with what little info there is on Keycode Constants but as I am sure most of you know - Access help is not really as helpful as it should be especially to those of us who are not that experienced with VBA and so on.

Any help or examples would be great.

cheers,

Kenny
 
Try the KeyDown! KeyCode=13

Best regards,
Tibi
 

Another Option:
Place your code in the the On Exit event of the textbox. Hitting return will normally trigger the On Exit event. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Perhaps a better choice is to place they action that you want to occur in the AfterUpdate event of the text box. That way the action will only occur if the contents of the text box have been changed by the user.

Uncle Jack
 
Hey guys,

Thanx for the tips, it all works fine now,

Cheers,

KennyUK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top