Hi Paul,
Try the following:
- Create a public variable behing your Form
Dim KeyInt As Integer
- For the KeyDown event of your textbox control add the following
If KeyCode = vbKeyReturn Then
KeyInt = vbKeyReturn
End If
- For the Exit event of your textbox control add the following
If KeyInt = vbKeyReturn Then
Cancel = True
End If
I hope this helps! If you have additional questions on this topic, please
respond back to this posting.
Regards,
Eric Butts
Microsoft Access Support
(e-mail address removed)
"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."
This posting is provided "AS IS" with no warranties, and confers no rights
--------------------
| From: "Paul Johnson" <
[email protected]>
| Subject: Change Default [Enter] key behavior
| Date: Sat, 5 Jun 2004 12:40:48 -0400
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.access.forms
| NNTP-Posting-Host: pool-151-200-49-41.res.east.verizon.net 151.200.49.41
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.access.forms:268863
| X-Tomcat-NG: microsoft.public.access.forms
|
| In the Access Tools/Options menu, under the Keyboard tab, I have selected
| the "Don't Move" option in the "Move after Enter" option box. This is the
| desired setting for the main form in my current application, but these are
| user-defined settings for the Access environment, not specific to a
database
| file. Is there a way to set this property in code?
|
| I thought it might be the DoCmd.DoMenuItem, but I don't see how to get to
| the tab and property.
|
| Any help is appreciated.
|
| Paul Johnson
| Alexandria, VA
|
|
|