PDA

Click to See Complete Forum and Search --> : Keydown event not triggered


droopy928gt
May 10th, 2006, 08:39 AM
I've searched to the forum but can't find any reference to the problem that currently is driving me more and more to the brink of insanity. Hope that some of you more experienced users might shed some light on it or push / kick me in the right direction.

I'm using excel 2003 (v11) and a VBA program as a database to display certain information depending upon certain criteria given by the user.

The problem driving me insane at the moment is that after refilling the excel sheet from a masterfile the keydown event is not triggered anymore.

Even weirder is the fact that all works properly again after clicking another program into the foreground and then to the background again.

Does this sound familiar to anyone and might you know what is happening here?

Thanks for any hints or tips or kicks into the right direction.

Best regards,

Leon

DKenny
May 10th, 2006, 08:57 AM
Leon, welcome to the forums.
A couple of questions.

The Keydown event is associated with what object?

In your "refill" procedure do you at any point disable events?

droopy928gt
May 11th, 2006, 01:49 AM
Hi Declan,

Thanks for the welcome and reply.

I don't completely understand the disabling events parts as I thought that events could not be disabled. Only objects could!?

Where the problem is most notable, the keydown event is related to textbox objects.

Basically what is done is I have a workbook containing the code for the application and the data this code uses for its results to be displayed to the user.

The masterfile is another workbook which is opened, checked for new data which is then copied into the first workbook after which the masterfile is closed again.

Depending upon what the user does certain objects like textboxes, listboxes, comboboxes, buttons, frames, etc are disabled and enabled when needed.

The strange thing is though that after loading data from the master file, the keydown event for the whole application is not triggered. Only after bringing another application into the foreground and then return it to the background will the keydown event be triggered again in the application. All other events work properly, e.g. doubleclick, click, change, enter. Strange detail with it is for e.g. textboxes, the text typed will end up in the textbox itself but its keydown event is not triggered.

The application itself is basically 1 userform, on it a multipage control with 4 tabs in which the respective control objects are located. Most control objects are grouped in frames to distinguish certain functionality or related controls

From what I understand of the problem so far is for the keydown event to somehow end up somewhere else, but I don't understand where. It looks a bit like the problem described here

http://weblogs.asp.net/cschittko/archive/2005/01/26/360849.aspx

It's become a very long winded answer but I hope you can kick me in the right direction or have an idea of whats going on.

Thanks and best regards,

Leon