after enter

  • Thread starter Thread starter JIM.H.
  • Start date Start date
J

JIM.H.

Hello,
I have two text fields in my form. I have "on enter"
trigger on my first field and I do not want focus to go
the second field when user press enter, how can I do this?
Thanks,
 
Hi Jim,

In the KeyDown event you want to get for the KeyCode of "13"


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."




--------------------
| Content-Class: urn:content-classes:message
| From: "JIM.H." <[email protected]>
| Sender: "JIM.H." <[email protected]>
| Subject: after enter
| Date: Mon, 23 Feb 2004 15:58:30 -0800
| Lines: 7
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcP6aPAQM7GhE7peQOCSbBtoTGtSPg==
| Newsgroups: microsoft.public.access.forms
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.forms:256585
| NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
| X-Tomcat-NG: microsoft.public.access.forms
|
| Hello,
| I have two text fields in my form. I have "on enter"
| trigger on my first field and I do not want focus to go
| the second field when user press enter, how can I do this?
| Thanks,
|
|
|
 
Hi Jim,

Here's the code in detail (the Textbox name is "Text2"):

Option Compare Database
Public intMyValue As Integer

Private Sub Text2_Exit(Cancel As Integer)
If intMyValue = 1 Then
' Cancel equal to True keeps the control with focus
Cancel = True
End If
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
' the Enter key is KeyCode 13
If KeyCode = 13 Then
intMyValue = 1
Else
intMyValue = 0
End If
End Sub

Eric

--------------------
| X-Tomcat-ID: 99800111
| References: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) ("prabha")
| Organization: Microsoft
| Date: Tue, 24 Feb 2004 03:48:05 GMT
| Subject: RE: after enter
| X-Tomcat-NG: microsoft.public.access.forms
| Message-ID: <PVddFko#[email protected]>
| Newsgroups: microsoft.public.access.forms
| Lines: 44
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.forms:256606
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Jim,
|
| In the KeyDown event you want to get for the KeyCode of "13"
|
|
| Regards,
|
| Eric Butts
| Microsoft Access Support
|
| "Microsoft Security Announcement: Have you installed the patch for
| Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
| you to review the information at the following link regarding Microsoft
| Security Bulletin MS03-026
| <http://www.microsoft.com/security/security_bulletins/ms03-026.asp>
and/or
| to visit Windows Update at <http://windowsupdate.microsoft.com/> to
install
| the patch. Running the SCAN program from the Windows Update site will
help
| to insure you are current with all security patches, not just MS03-026."
|
|
|
|
| --------------------
| | Content-Class: urn:content-classes:message
| | From: "JIM.H." <[email protected]>
| | Sender: "JIM.H." <[email protected]>
| | Subject: after enter
| | Date: Mon, 23 Feb 2004 15:58:30 -0800
| | Lines: 7
| | Message-ID: <[email protected]>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="iso-8859-1"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| | Thread-Index: AcP6aPAQM7GhE7peQOCSbBtoTGtSPg==
| | Newsgroups: microsoft.public.access.forms
| | Path: cpmsftngxa06.phx.gbl
| | Xref: cpmsftngxa06.phx.gbl microsoft.public.access.forms:256585
| | NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
| | X-Tomcat-NG: microsoft.public.access.forms
| |
| | Hello,
| | I have two text fields in my form. I have "on enter"
| | trigger on my first field and I do not want focus to go
| | the second field when user press enter, how can I do this?
| | Thanks,
| |
| |
| |
|
|
 
Back
Top