Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

viewing cursor movement in subforms

Status
Not open for further replies.

ehdoh

Technical User
Joined
Aug 4, 2003
Messages
8
Location
US
Hello,

I have a tab control with a main form on the first tab and subforms on the remaining tabs (using Access2000). Each form is wider than the screen itself, so if I want to modify the fields that are out of view when the form is centered on the screen, I must use the horizontal scroll bar to bring certain portions of the form into view. If I enter data into the main form and use the tab key to move through the fields, the cursor will always remain in view because my screen centers the cursor and its location automatically (i.e., I don't have to use the mouse and scroll bar to manually see this)--and, so far as I know, I did nothing to make this automation happen. However, with my subforms that is not the case. With the subforms the screen centering does not shift with my cursor movement; I can only see the full screen with the use of the mouse/scroll bar (which I am trying to minimize).

Some colleagues suggested I try the "size to fit window" option under the Window menu, and one suggested I needed to do this along with the "vertical only" view of the scrollbars (under form properties). I have tried both of these things and neither seems to work. Do any of you know how to fix this problem (other than altering the size of all my controls on the subform so that in its entirety the subform is not wider than the screen)???

Thank you!
E.
 
you have got the auto-center option as yes in the properties of the subform?
 
Yes, AutoCenter is set to 'yes' on each subform as well as the mainform.
 
I see what you mean I found the same thing. I am not sure of the answer but I know it is possible (as a slightly ugly way of doing it) to do

sub Text_Enter
Me.GoToPage 1, Me!Text.Left , 0
end sub

you would have to organise the position a bit, just an idea.

Hope it helps
Chris
 
Thank you for your responses. I would like to try your proposed solution. Would I enter the code you posted in any particular place - i.e., a specific control and/or event?

Cheers,
E.
 
All the controls of the subform where you want the user to be able to see the control

You just have to change Me!Text for Me!ControlName each time otherwise it is always the same code

ex
Sub Control1Name_Enter ()
Me.GoToPage 1, Me!Control1Name.Left , 0
end sub


 
I tried your proposed solution (and many variations of it) several times. Unfortunately every time I get an error message. Sometimes it's a syntax problem. Then I fiddle with it and will get a 'method not found' problem. Then I'll fiddle and be told the DoCmd field cannot be located (sometimes I included DoCmd since it seems I need to, sometimes I try without).

Any other suggestions?????
 
a lot easier is eg you have a textbox text1 in the subform :

'This is the event for when the cursor enters the textbox
'Properties - event - on entering (i have the french version and that is Sur Entrée)

sub Text1_Enter()
Me!Text1.SetFocus
end sub

You do this for all the textboxes. It doesn't work for labels as SetFocus doesn't exist for labels
 
I very much appreciate the second suggestion, but it still did not do the trick...any other suggestions??

Since this is happening universally within my subforms on the tab control -- but only when they are represented as subforms, not when the subforms exist on their own as individual forms -- I suspect the problem may lie somewhere in the properties setting of the subform itself. I just do not know where within the property settings the problem might lie (assuming my hunch is correct)...
 
Think I found it

In the subform properties event Key Preview (Apercu des touches in my french version) as YES

 
Thank you so much for sticking with me on this, Chris. I wish I could reply with excitement, saying that your solution worked...unfortunately the 'key preview' property did not do the trick either.

Any other suggestions?

-Elaine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top