Main form focus to remain on top (1 Viewer)

Gismo

Registered User.
Local time
Tomorrow, 01:11
Joined
Jun 12, 2017
Messages
1,298
Hi all,

I have a form with a TAB form
when I open my main form, the focus was at the bottom of the page
I Change the tab order on the main form and that seemed to have solved the problem

The issue is still have is when i click on any of the tabs in the TAB form, the focus jumps back to the bottom of the main form

Any suggestions please
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:11
Joined
Oct 29, 2018
Messages
21,469
Resize your form to fit your screen?
 

Gismo

Registered User.
Local time
Tomorrow, 01:11
Joined
Jun 12, 2017
Messages
1,298
Resize your form to fit your screen?
We have 3 different size screens in our company, 2 sizes in monitors and 2 different sizes in laptops
I dont want the size to be too small and the big monitor
I have not managed to do auto resize as yet
would prefer to move the focus to the top of the screen regardless of the tab in the main screen
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:11
Joined
Oct 29, 2018
Messages
21,469
We have 3 different size screens in our company, 2 sizes in monitors and 2 different sizes in laptops
I dont want the size to be too small and the big monitor
I have not managed to do auto resize as yet
would prefer to move the focus to the top of the screen regardless of the tab in the main screen
If the form fits the screen, then it won't move or scroll no matter which control has focus or tabbed to. You can create a small form and use auto resize to handle different size screens. Before that, you could try forcing the focus to the top of the form. If there is no control at the top of the form to receive the focus, you can create a very small one.
 

Gismo

Registered User.
Local time
Tomorrow, 01:11
Joined
Jun 12, 2017
Messages
1,298
If the form fits the screen, then it won't move or scroll no matter which control has focus or tabbed to. You can create a small form and use auto resize to handle different size screens. Before that, you could try forcing the focus to the top of the form. If there is no control at the top of the form to receive the focus, you can create a very small one.
Hi Have my very first control on the main form as my first tab order
it problem comes in when i click any of the tabs on the tab form
then it jumps back down again
how do i force the tabs on the subform to conform to the main form tab order?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:11
Joined
Oct 29, 2018
Messages
21,469
Hi Have my very first control on the main form as my first tab order
it problem comes in when i click any of the tabs on the tab form
then it jumps back down again
how do i force the tabs on the subform to conform to the main form tab order?
Can you post a screenshot of your form? Does it fit the entire screen? You could try adding code in the focus event of your tab to set the focus back to the control at the top of your main form. However, if you go to the subform, your form will scroll down again.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 18:11
Joined
Feb 19, 2002
Messages
43,266
This is probably a Windows issue. As theDBguy said, you have to resize the tab control so it fits on the screen.

There is resizing code available for free. I think it is posted here or you can purchase some at Resize Microsoft Access Forms with ShrinkerStretcher from Peter's Software (peterssoftware.com)

I haven't had to use it in a while but it probably works in newer versions of Access too. You import the code modules and then change the OpenForm commands to use Peter's code.
 

Gismo

Registered User.
Local time
Tomorrow, 01:11
Joined
Jun 12, 2017
Messages
1,298
Can you post a screenshot of your form? Does it fit the entire screen? You could try adding code in the focus event of your tab to set the focus back to the control at the top of your main form. However, if you go to the subform, your form will scroll down again.
The form does not fit the screen, slightly lager to accommodate other users with larger monitors

Project leader is my first tab in order to set focus
Once I click on any of the back, the scroll moves down to align with the tab control

1643721700589.png
 

Gismo

Registered User.
Local time
Tomorrow, 01:11
Joined
Jun 12, 2017
Messages
1,298
Sorry, forgot to submit
This is the reply on post 6
 

theDBguy

I’m here to help
Staff member
Local time
Today, 15:11
Joined
Oct 29, 2018
Messages
21,469
Hi. Thanks for the additional information. As I said all along, the problem is your form doesn't fit the screen (you can test this by checking your form on larger screens to see if the problem goes away).

Also, as I said earlier, you can certainly use some VBA to force the focus to the top of the form, but like I also said, that means you won't be able to use your subforms, because when they get the focus, the form will tend to scroll down.

So, the only real solution is to shrink your form to fit the smaller screens and use a resizer code to accommodate the larger screens.
 

isladogs

MVP / VIP
Local time
Today, 23:11
Joined
Jan 14, 2017
Messages
18,217
In case it helps, here is a link to my automatic form resizing code
 

Users who are viewing this thread

Top Bottom