A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

enter key within a field on a form



 
 
Thread Tools Display Modes
  #1  
Old August 25th, 2005, 12:19 AM
Patrick Stubbin
external usenet poster
 
Posts: n/a
Default enter key within a field on a form

once i type a value for a form field i wish to test if the enter key has been
pressed, if it has i wish to close the form, how do i test for the enter key
being pressed, i know it is chr(13)???
--
Regards


Patrick Stubbin
  #2  
Old August 25th, 2005, 12:48 AM
Ofer
external usenet poster
 
Posts: n/a
Default

On the KeyDown event of the field enter the code

Private Sub FieldName_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
DoCmd.Close
End If
End Sub


"Patrick Stubbin" wrote:

once i type a value for a form field i wish to test if the enter key has been
pressed, if it has i wish to close the form, how do i test for the enter key
being pressed, i know it is chr(13)???
--
Regards


Patrick Stubbin

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box NotInList - How To Add Data To Underlying Table 10SNUT Using Forms 19 July 8th, 2005 09:12 PM
strategy for data entry in multiple tables LAF Using Forms 18 April 25th, 2005 04:04 AM
Requerying a pop up form to display in the main form Jennifer P Using Forms 13 April 5th, 2005 06:59 PM
Enter data in 1 text form field & have multiple locations filled i James General Discussion 4 August 12th, 2004 10:02 PM
dlookup miaplacidus Using Forms 9 August 5th, 2004 09:16 PM


All times are GMT +1. The time now is 09:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.