UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Cursor "trapped' In A Subform, Access 2003    
 
   
whdyck
post Mar 7 2018, 02:57 PM
Post#1



Posts: 264
Joined: 20-July 11
From: Winnipeg, MB, Canada


Probably a bonehead question:

I have a form with a subform control. When my cursor moves into the subform, tab as I might, I cannot move the cursor out of the subform. In the attached pic, I show the subform in a purple outline. Tabbing out of the date control puts the cursor into the subform, from where continually tabbing just leaves the cursor trapped in the Meter In box.

I've indicated in the pic what the tab orders are: #3 is the subform control, and within the subform, the Meter In control has a tab order of 1.

Any ideas?

Thanks.

Wayne


Attached File(s)
Attached File  Trapped_Curser.png ( 26.93K )Number of downloads: 7
 
Go to the top of the page
 
doctor9
post Mar 7 2018, 03:03 PM
Post#2


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


Wayne,

Short answer: Use CTRL-TAB to move from a sub-form back to the main form.

Long answer: I believe the idea is that you'll usually have a Single main form with a Continuous subform, like a grocery receipt. The main form has info about your grocery store visit, like the date of the visit, your credit card info, and which cashier scanned your groceries. The continuous subform is your list of purchased groceries. So, the logical thing is to let the user easily use TAB to fill in the main form details, then move to the subform control. But once in the subform control, the most likely thing to happen is that the user will want to enter more than one record. Not ALWAYS. But more often than not. Hence, this design. Again, this is just me guessing, based on my personal experience.

Hope this helps,

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
DanielPineault
post Mar 7 2018, 03:03 PM
Post#3


UtterAccess VIP
Posts: 6,068
Joined: 30-June 11



The behavior is typical of Access, but you can trap the tab key sequence in the last control in the subform to return it back to the main form.

--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
DanielPineault
post Mar 7 2018, 03:04 PM
Post#4


UtterAccess VIP
Posts: 6,068
Joined: 30-June 11



QUOTE
Short answer: Use CTRL-TAB to move from a sub-form back to the main form.


All these years and I never knew that key sequence. Thanks for sharing Dennis! hat_tip.gif



--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
doctor9
post Mar 7 2018, 03:10 PM
Post#5


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


Daniel,

One of my very first databases was a Bills database where I had Date, Customer, and Purchase Order # controls in the top of the main form, a continous subform control, THEN Tax and Shipping controls AFTER the subform. I needed to find out how to get in and out of that subform without reaching for the mouse, and I found it in the classic white User's Guide that came with Access 97. (Just double-checked, since it's always on my desk... yep, Part 1, Chapter 4, the Summary of Keyboard Techniques section.)

For the record, I hate using the mouse unnecessarily (tendonitis in my right shoulder), and learned a bunch of shortcut keystrokes when Windows 3.1 was taking over.

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
DanielPineault
post Mar 7 2018, 03:34 PM
Post#6


UtterAccess VIP
Posts: 6,068
Joined: 30-June 11



QUOTE
I hate using the mouse unnecessarily (tendonitis in my right shoulder), and learned a bunch of shortcut keystrokes when Windows 3.1 was taking over.


That was me with AutoCAD 12-14 (yes, I just dated myself dazed.gif ). I knew all the keystrokes and could out perform the most seasoned designer just because they had to find button and I just pressed a couple keys. Great thing to be aware of.



--------------------
Daniel Pineault (2010-2017 Microsoft MVP)
Professional Help: http://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: http://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
whdyck
post Mar 7 2018, 03:41 PM
Post#7



Posts: 264
Joined: 20-July 11
From: Winnipeg, MB, Canada


Thanks to you both! That's great.

So I'm thinking that in the last control on the subform, I should be able to have code like this:

CODE
Private Sub txtOdometerInRaw_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo txtOdometerInRaw_KeyDownErr

    ' Main Line
    If KeyCode = vbKeyTab Then
        Shift = vbKeyControl
    End If

txtOdometerInRaw_KeyDownBye:
    Exit Sub

txtOdometerInRaw_KeyDownErr:
    Select Case Err.Number
        Case Else
            MsgBoxErr "fsubUntAsnUnitBookingsReturnMeters: txtOdometerInRaw_KeyDown"
    End Select
    Resume txtOdometerInRaw_KeyDownBye
End Sub

But it doesn't work. Should I be able to do something like this?

Thanks.

Wayne
Go to the top of the page
 
doctor9
post Mar 7 2018, 04:11 PM
Post#8


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


Wayne,

What I meant was that you shouldn't need any code. Just use CTRL-TAB when you have entered the two meter values. But since the subform is so tiny, I can see how that might be confusing to the user.

But now I'm re-reading your post, and something seems odd here:
> Tabbing out of the date control puts the cursor into the subform, from where continually tabbing just leaves the cursor trapped in the Meter In box.

Are you also saying that the user can't get to the Life Meter In control? You have a purple number 2 next to Life Meter In, so I'm assuming it's a control that the user interacts with. But if the cursor is "trapped in the Meter In box" that sounds like you have another problem.

Now, if the above is not really a problem, and you meant to say that the user is just moving from Meter In to Life Meter In, and back to Meter In repeatedly, here's what I'd try: Set the focus to the parent form, then set focus to the Fuel Up Pool Units Upon Return checkbox control. (I think you need to do both. I seem to recall there being an issue when trying to use .SetFocus on another form's control in one step.) In short, don't try to artificially "press" the Control key, just use DoCmd.SetFocus method to move the cursor where you want it.

Have you considered using two textboxes instead of the subform? Without knowing more about your data, it's hard to guess how difficult this would be, but it might be an option for simplifying things.

Hope this helps,

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
tina t
post Mar 7 2018, 04:25 PM
Post#9



Posts: 5,518
Joined: 11-November 10
From: SoCal, USA


QUOTE
When my cursor moves into the subform, tab as I might, I cannot move the cursor out of the subform.

if you have been specifically hitting the Tab key, try the following: get rid of all the code you've been trying to use to move out of the subform, so it's "clean". (maybe you want to make a copy of the db first, and do this test in the copy.) then try using the form as usual (like a user would), but instead of using the Tab key, use the Enter key to move through the controls in the subform, and see if it will just move on out of the subform to the next tab stop in the parent form.

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
whdyck
post Mar 7 2018, 05:12 PM
Post#10



Posts: 264
Joined: 20-July 11
From: Winnipeg, MB, Canada


Thanks, Dennis.

Yeah, the Life Meter In has no Tab Stop (it's a calculated control), so I shouldn't have expressed it that way. There's really only one control in the subform that the user interacts with.

I'll try to just use Setfocus to get the desired result, as you suggest.

Yes, actually I thought of using two textbox controls. (Actually had it partly working.) Then I decided it might be simpler to move to a subform. But nothing's simple with this stuff, I suppose.

Thanks for the tips!

Wayne
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    22nd September 2018 - 11:50 AM