Sub form steals focus

shepHeard

Registered User.
Local time
Today, 23:20
Joined
Apr 14, 2006
Messages
27
Hi, this is frustrating, and a little complicated, so I'll try and explain it as best I can..

I have a form with two sub forms.

The main form "fmMain" contains a list of species. the subform which is causeing me the problems lists loci specific to each species. The user can search by a species or locus and resrict the list accordingly.

Now, here is the problem. The form is too large for my screen, so I have some scroll bars on fmMain. However, whenever the user performs some kind of search the focus shifts to the subform (I guess), causing the screen to scroll to the middle. From here you can't see the species info, and after each navigation the user has to scroll back up again. It's frustrating having to continually scroll around the screen.

Is there anything that can be done to stop the focus shifting around? I'd rather that when the user performed some action the screen just simply didn't move.

Cheers - sorry for the monster post! (hope it all makes sense)
 
Last edited:
Hmm, I wish I had a perfect fix for this problem, but my best suggestion would be to shrink your form to fit the screen and perhaps use a some tabs to switch back and forth from the two subforms. I don't know if they need to be viewed at the same time.

Good luck in your search.

alteque
 
Hi - Cheers for your reply.

Unfortunately shrinking the form isn't an option..

Rather than flipping between subforms, what happens is when I apply a filter or do cmd.goto ... the screen focuses on the first textbox in the subform. This moves the form, and in order to see which record you've just gone to in the main form you have to manually scroll up. Every time. Irritating.

I'll try and trap the focus shift event - see if it happens during a specific action... It maybe when the macro changes the record source of either the main form or the subform, or maybe the on_current action of either... I'll report back.

Cheers anyway,


M$ quirks are the reason I can't stop smoking.
 
Hi ShepHeard,

Screen resolution

If you cannot reduce the form size is it possible to increase the screen resolution (obviously dependant on the form size, this will depend on what screen resolution you increase it too, if possible?)? With a screen resolution increase (dependant on your screen capabilities) you might find a re-design is in order as you'll be able to fit more along the sides of the form.

These types of forms that you have built in my experience are annoying for users to use, it is best if you either make it fit or use a higher screen resolution which help make it fit. Unfortunately sometimes this is not possible. Can you look at breaking the form up in any way, half of it on another form?

Apart from that I do not have a solution, if changing the resolution is not possible good luck with trying to get a solution.

I used to build forms to 800 X 600, but now computer monitors have advanced to 1280 X 1024 so I build forms @ 1024 X 768 (I try to avoid using resolution 1280 X 1024), only in one instance where I knew all user had thier screen set to 1280 X 1024 did I build a form to this resolution. If the 1280 X 1024 form is viewed on less resolution it will then pop-up the bars that you mention and the complete form will not be seen on one screen.

I suppose within a company this is where standardisation plays a big role, but only if you have the budget!!!

Focus
You are investigating this, but it would be the avenue I would also look at, after any search is conducted, set focus back to first field on the form, not sure if this will help?

I hope this info helps.:rolleyes:

Robert88
 
Last edited:
Cheers Robert88,

Unfortunately I'm trying to work to the smallest resulution likely as this database is for distribution by a company to other people. However, I find there is too much information to fit it all on one page with this resolution, so I'm stuck!

I'm goinf to try and find at what point the focus shifts when I apply the SQL to the forms, and do something from there to shift the focus back to the top... I only worry that this will lead to the form jumping up and down all the time.. we'll see.

;o|
 
OK... so the focus shift occurs *after* the on_current event of the main form... usually...

It seems fine - i.e. doens't jump around at all so long as I'm navigating using the next or previous buttons in the main form, or changing the main form SQL.

However, if I use the next/previous buttons in the sub form, which also cycle through the records of the main form, the focus shift occurs after the on_current event of the *other* subform, before the on-current event of the main form.

This causes the screen to flicker as it moves up then down again.

However (again) if I add a setfocus event in at the end of the on_current event of the other subform, this subform ends up being repositioned within the form. Very irritating.


Ugh. Hate it when a plan doesn't come together..
 
Did you ever figure out a solution to this problem? I am having the same issue with a form focusing on a subform after on_current.
 

Users who are viewing this thread

Back
Top Bottom