D
David W. Fenton
I have a *very* weird problem (Access 97) that first developed
sporadically a couple of days ago while working, and that now
happens all the time.
The symptom is this:
When I try to edit the controls on the form, keyboard input is
ignored.
It's not the keyboard, because in the Immediate Window I can still
type.
It's not a record lock, because I can open the table and edit the
record without problems.
The controls are not locked if I check the .Locked property in the
Immediate window.
The underlying recordsource is not uneditable because I can change
values in the underlying fields or the controls by assigning them
through the immediate window.
And certain keystrokes still work -- I can select text in a control
with the mouse and hit the DELETE key and the selection is deleted.
It seems to be blocking the shift keys and the alphanumeric keys (as
well as BACKSPACE).
Some things that couldn't be the problem:
- There are no form timers used anywhere in this form.
- KeyPreview is set to NO by default.
AAARRRGGGHH!!! I just tried setting KeyPreview, and wrote a KeyPress
event but left KeyPreview off by mistake, and then it worked again!
When I turn KeyPreview on, it still works, and now I can't get it to
*not* work!
The form is a very, very complex form (it's original OnCurrent event
long ago grew too large for a single event procedure!), and has a
lot going on. A couple of days ago I added a web browser control to
it, and yesterday added a procedure that writes to a temp database
within a transaction and then rolls back the transaction after
pulling out the data. Those are the big changes in this form from
last week, and the problem in its sporadic form predated the
addition of the temp database rollback. It seems to have come up
around the same time as I added the web browser control.
I've decompiled and compacted and all that, but have not yet rebuilt
the form with SaveAsText (that's next on the agenda). I rewrote the
code that locks and unlocks controls (using methods similar to what
Tony Toews describes in
http://www.granite.ab.ca/access/locking_fields_on_a_form.htm, though
I use a custom collection so as not to have to walk the .Controls
collection but once -- I've been doing that in apps for nearly a
decade, so it's tested code that has been working in many apps for a
very long time).
Any ideas at all what might be the cause of this?
- it's not the keyboard, because the Immediate Window still takes
input.
- other forms are not affected by it, so far as I can tell.
- it has nothing to do with the underlying locking or uneditability
of either the tables, recordsources or controls involved.
What could be happening to my keyboard input?
sporadically a couple of days ago while working, and that now
happens all the time.
The symptom is this:
When I try to edit the controls on the form, keyboard input is
ignored.
It's not the keyboard, because in the Immediate Window I can still
type.
It's not a record lock, because I can open the table and edit the
record without problems.
The controls are not locked if I check the .Locked property in the
Immediate window.
The underlying recordsource is not uneditable because I can change
values in the underlying fields or the controls by assigning them
through the immediate window.
And certain keystrokes still work -- I can select text in a control
with the mouse and hit the DELETE key and the selection is deleted.
It seems to be blocking the shift keys and the alphanumeric keys (as
well as BACKSPACE).
Some things that couldn't be the problem:
- There are no form timers used anywhere in this form.
- KeyPreview is set to NO by default.
AAARRRGGGHH!!! I just tried setting KeyPreview, and wrote a KeyPress
event but left KeyPreview off by mistake, and then it worked again!
When I turn KeyPreview on, it still works, and now I can't get it to
*not* work!
The form is a very, very complex form (it's original OnCurrent event
long ago grew too large for a single event procedure!), and has a
lot going on. A couple of days ago I added a web browser control to
it, and yesterday added a procedure that writes to a temp database
within a transaction and then rolls back the transaction after
pulling out the data. Those are the big changes in this form from
last week, and the problem in its sporadic form predated the
addition of the temp database rollback. It seems to have come up
around the same time as I added the web browser control.
I've decompiled and compacted and all that, but have not yet rebuilt
the form with SaveAsText (that's next on the agenda). I rewrote the
code that locks and unlocks controls (using methods similar to what
Tony Toews describes in
http://www.granite.ab.ca/access/locking_fields_on_a_form.htm, though
I use a custom collection so as not to have to walk the .Controls
collection but once -- I've been doing that in apps for nearly a
decade, so it's tested code that has been working in many apps for a
very long time).
Any ideas at all what might be the cause of this?
- it's not the keyboard, because the Immediate Window still takes
input.
- other forms are not affected by it, so far as I can tell.
- it has nothing to do with the underlying locking or uneditability
of either the tables, recordsources or controls involved.
What could be happening to my keyboard input?