Button problems

1234adam

Registered User.
Local time
Today, 14:51
Joined
Jun 18, 2004
Messages
14
I have my tab order set the way I want to but the problem is I would like to enter on the command buttons but it won't let me. The first button is "Lastest Entry" the next button is "New Entry". When I open my form it starts on "Latest" but will not do anything on enter, I have to click it with my mouse. It then moves to "New" but still the same thing. What can I do so that I can enter through these buttons to make things faster.
 
What code have you got on the buttons?
 
Tried Spacebar?

Try tabbing to one of your buttons and pressing spacebar. When a button has focus, spacebar, enter, and maybe other keys too, should click it.

If spacebar works, then there might something that is stopping the button from responding to Enter, though I can't think of anything off the top of my head.

If spacebar doesn't work, then that's a puzzle.

Sorry this isn't much help. It might help diagnose the problem though.

Another trick you could try is giving your buttons an "accelerator". If you make the text on your LE button read "&Latest Entry", then the L will be underlined and [Alt] + L will be assigned as a keyboard shortcut that clicks the button.
 
I am just using macros to perform the button functions.

It is the same thing with the space bar. I have tried the accelerater also but it does not work the way I would like.

What I have noticed is that the focus does not stay on the form. I don't know if it is because of the subform or what. When I open a form I have to click somewhere on the form and then the focus will be on the latest entry. Then if I hit enter it does not go to the new button until I click somewhere on the form.

Any Suggestions.
 
Losing focus

One of my forms loses focus too. The user has to click on the form before standard keystrokes will work. I'm not sure why this happens, but there's quite a lot of code this form, and there might be some operations that make focus vanish.

I'll check back in case you find a solution and post it.

Cheers.
 
adam_fleck said:
One of my forms loses focus too.
Just being picky but if a form has active controls capable of getting the focus then a form can't get the focus or, in your instance, lose it.
 
A loose manner of speaking?

Mile-O-Phile, what you say makes complete sense, and, yep, you're right.

But here is something that can happen - though I've been unable to replicate it:

A form works just as it should. Key strokes such as [Tab] and [PgDn] are accepted, and if the form's key-preview property has been set to Yes, trapped keystrokes produce the expected results.

Then the user moves to a new record, and... No control on the form appears to have "full focus". Although the application is still the active Windows Application, keystrokes such as [PgUp] or [Tab] have no effect.

Strangely, keystrokes programmed through Autokeys still work - after a fashion: although they'll move focus, they won't restore keyboard response.

For instance, if you have the Autokeys shortcut ^M setfocus on some control on the form, sure enough, on [Ctrl]+M, focus will move there. But the control - the whole form it seems - still won't respond to keystrokes. [Tab], for example still doesn't work.

I've found this quite a puzzling behaviour to describe. It seems natural to say "the form has lost focus", although a better desciption is perhaps that the form seems to have yielded the keyboard to the application and will not take it back, unless the user persuades it with a mouse click.

I've been unable to find a way round this. Even putting a DoCmd.OpenForm "Form_Name" in the function Ctrl_M(), which is called by Autokeys ^M, doesn't always fix it.

The problem doesn't bother me too much, as the behaviour happens for me only when the user - despite being asked not to do this - tries to scroll from record to record while a browser window is open on an html-cached version of a Word document.

It looks as if 1234adam has run up against a similar problem. Maybe he'll post a cut down version of it and let us have a look.

I can't post a cut down version of the thing I'm working on, because it's an adp, half of it belongs to someone else, and some of the code is still horrible.
 

Users who are viewing this thread

Back
Top Bottom