473,503 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enter Key Behavior... is there more?

3 New Member
Hi, I'm using XP, and am trying to control the enter and tab keys within a form. I have used the Enter Key Behavior function within Access, it does very little for me though. What I am trying to do is:
a. when the enter key is pressed, goto next record. It does this but only to the same field in the next record, not the tab 0 field.
b. when the enter key is pressed and the field isnull, goto a different control.
I have tried key up, down and press, as well as other functions.
thanks, any assistance is greatly appreciated.
Feb 19 '08 #1
4 2732
jeffstl
432 Recognized Expert Contributor
On getting your focus to go back to tab 0 you will need to just use a .SetFocus property on that control at the end of the code you are using for that event.

For your second problem, I'm not clear on what the actual error is you are getting or problem you have. Are you saying if there is a null field in your record you want it to proceed to the next record?

That should be able to be capture with a if isNull(MyField) condition, then just do a .MoveNext under that.
Feb 19 '08 #2
jvwhittaker
3 New Member
thanks jeffstl,

these are valid solutions, but not what I'm after.

What I think I need is Access to goto a new record when enter key is pressed within any of a record's 15+ fields. Tab still needs to go to the next field.
The other is when the enter key is pressed in a specific field and it is null, I can send the cursor to another control. Basically if I hit enter on my keyboard twice, I go to a different subform tab 0 control waiting for input. Double enter again I'm further along the trail..... I don't think it's a readily available function of the field or form but an enter Key Behavior modification?

On getting your focus to go back to tab 0 you will need to just use a .SetFocus property on that control at the end of the code you are using for that event.

For your second problem, I'm not clear on what the actual error is you are getting or problem you have. Are you saying if there is a null field in your record you want it to proceed to the next record?

That should be able to be capture with a if isNull(MyField) condition, then just do a .MoveNext under that.
Feb 19 '08 #3
missinglinq
3,532 Recognized Expert Specialist
This code will set the focus on a particular control every time you move to a different record.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   YourTextboxName.SetFocus
  3. End Sub
  4.  

The other part of your question is a little murky. You want hitting <Enter> to take you to the next record and you want hitting <Enter>, when the current textbox is empty, to take you top another control, rather than to another record?

Welcome to TheScripts!

Linq ;0)>
Feb 19 '08 #4
jvwhittaker
3 New Member
thanks missingling,

this does go to the field perfectly, but I think I need to go to a new record. And then part 2 is if I hit enter again and it is null go to another control, if not null a new record. I tried form_current goto new record, but it loops itself. A short example is I have a photo and I can put a number in a size field 5x7, 6x4 etc... as I tab across the different sizes I can either leave it blank or put in a number. At any time in that record, when I hit enter I want to go to a new recored, I then can enter a new photo or if I hit enter again I want to go to another control ie Frames. thank again

This code will set the focus on a particular control every time you move to a different record.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.   YourTextboxName.SetFocus
  3. End Sub
  4.  

The other part of your question is a little murky. You want hitting <Enter> to take you to the next record and you want hitting <Enter>, when the current textbox is empty, to take you top another control, rather than to another record?

Welcome to TheScripts!

Linq ;0)>
Feb 19 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
20358
by: jerrygarciuh | last post by:
Hello, I have been playing with various Googled solutions for capturing the <Enter> key to suppress form submission. My first question is whether anyone has a script that works in all common...
10
4366
by: Deano | last post by:
I think that just about sums it up. Is there a fix/workaround for this?It's quite annoying behaviour and not user-friendly.thanksMartin
7
37928
by: deko | last post by:
I have a textbox in a form into which users enter a string to execute a search. After the user presses Enter, I'd like the focus to go back to the textbox, but the default behavior of the Enter...
5
2929
by: Eric | last post by:
Hi All, I'm very experienced in traditional ASP and am new to (am learning) ASP.NET. FYI: I am initially learning ASP.NET with VB.NET to ease the transition for me. I have encountered what I...
2
3104
by: 23s | last post by:
My site's login page has a form w/ 2 textboxes and a submit button. If I'm in either of those textboxes (i.e., either one of the textboxes has focus), in any given browser, hitting "enter" on my...
5
3111
by: ewillyb | last post by:
Hi, ASP.NET has some interesting behavior when the user hits the Enter key. If there are multiple ASP:Buttons (rendered as HTML submits) on the form, when the user hits enter, the first button's...
15
4011
by: Adam J. Schaff | last post by:
I have noticed that if a user closes a form via pressing return (either while the OK button has focus or if AcceptButton is set to OK for the form) then the "ENTER" keypress event fires ON THE...
18
4582
by: Zytan | last post by:
I want the same function to be run whether you press Enter or double click the listbox. It seems really verbose to write both handlers to both events everytime, even if they both call the same...
13
2656
by: AliRezaGoogle | last post by:
Dear Members, I have a problem in the concepts of Monit.Enter and Monitor.Exit (Before everything I should say that I know how to solve this problem by using Monitor.Wait and I do not need a...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.