Problem with keyboard input being locked in a form

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?

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
7/24/2007 8:08:09 PM
access 16762 articles. 3 followers. Follow

4 Replies
1032 Views

Similar Articles

[PageSpeed] 32

"David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
news:Xns9977A4240C264f99a49ed1d0c49c5bbb2@127.0.0.1: 

> 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. 

OK, I just discovered something. 

If I open the form and use the first tab page (with most of the
important editing controls), I can edit, and load new records and
edit and have no problems. 

As soon as I view the tab page with the web browser control on it,
when I go back to the first page, the keyboard input is being lost.
That is, I put in a KeyPreview event to write out the
ActiveControl.Name and the keystroke entered, and once I view the
tab with the web browser control on it (it's actually in a subform),
all keyboard input is gone -- it doesn't make it to the KeyPreview
event. 

My first thought was that perhaps when the web browser control got
the focus, it did something weird, so I tried set it to last in the
tab order on its tab page. 

AND IT WORKED!

I was able to type in the fields on the web browser control's tab
page, as well as go back to the first page and type there. 

But as soon as I clicked on the web browser control, then all
keyboard input was discarded. It's as though the web browser control
never gives up focus, and I tested it and found that's it's
absolutely true! If I click on the web browser control, then click
in an editable field, then hit Ctrl-A, the text in the web browser
control is selected! It doesn't matter where the cursor is if the
web browser control is visible -- Ctrl-A selects the text in the
browser control. 

So, what I'll do is put a transparent command button over it, with a
ToolTip that says "click to copy all to clipboard", since that's the
only reason the users need to be able to get to the tab control. 

Oh, no, that won't work! They've got to be able to scroll! Clicking
the scroll arrows doesn't cause a problem, but dragging the scroll
thumb does the same as giving it the focus. 

What am I going to do here?

Does anyone have any ideas on what to do?

Remember, this is Access 97.

BTW, has anyone used the Gecko ActiveX control? 

  http://www.iol.ie/~locka/mozilla/control.htm

It gives you the Mozilla/Firefox rendering engine in an ActiveX
control that has the exact same interface as the IE control. I'm
downloading it right now to see if it can be used and if it has the
same problems. 

Interestingly, the last time I checked that site, they didn't have a
binary version available! Nice that they finally do. I do wonder,
though, if I need to match the control version to the Mozilla
version on my client's PC (the client for whom this app is written
uses Mozilla as their main browser, though I don't know which
version -- probably an old one). 

I'll report back on this, as I don't think the IE control is going
to work (because of the scrollbar getting the focus). 

If anyone else can replicate the problem (in Access 97), I'd be
interested to hear about it. What you need is a form with two tabs,
a couple of editable fields on each tab, and a web browser control
on the second tab that is last in the tab's tab order. If you can
put that together and get the same result, then it's not just my
app's weirdness. Once I try Gecko, I'll then go back and see if I
can replicate it as described above. 

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
7/24/2007 8:45:43 PM
"David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
news:Xns9977AA81FD1EFf99a49ed1d0c49c5bbb2@127.0.0.1: 

> I'll report back on this

Well, the Gecko control doesn't seem to want to work in A97 (I'm
actually not too surprised). The object browser shows all the
correct properties/methods, but when the properties just don't show
up on the OTHER page of the control's properties sheet. 

I also tried it in Access 2000, where it didn't work.

But it *did* work in 2002! Maybe I can get it to work in the older
ones, as well. Well, strangely enough, the one I created in A2K2 (in
an A2K MDB) works now in A2K. I tried exporting to A97, but it
doesn't work there, either. *sigh* 

The other thing I discovered was that the IE control instantiates
itself in Access *above* the Access window's controls. That is, if I
put a transparent command button on top of it to try to prevent it
from getting focus, it doesn't work -- you can just click on it and
it gets the focus. 

So, at this point, unless anyone has any suggestions, I'm at a loss
as to how to fix the problem, other than converting to A2K or higher
and using the Gecko web browser control. That's a poor option, as
the client may not have licenses (maybe -- possible for A2K and
A2K2, but I don't know for sure -- they'd hate having it look
different on the different machines, and they hate *all* change!).
I'll have to do some testing to see if their app converts well to
A2K format. 

And I would love to hear any other suggestions on getting the thing
to work in A97. 

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
7/24/2007 9:41:13 PM
"David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
news:Xns9977B3EBB6CF3f99a49ed1d0c49c5bbb2@127.0.0.1: 

> So, at this point, unless anyone has any suggestions, I'm at a
> loss as to how to fix the problem

Well, I now have good news and bad news:

1. the IE control does not steal focus in A2K.

2. but it errors out with:

     The expression SetSecureLockIcon you entered as the event
     property setting produced the following error: There was an
     error loading an ActiveX control on one of your forms or
     reports. 

     *The expression may not result in the name of a macro, etc.
     etc. 

and then it gives the same error with "FileDownload" instead.
Needless to say, I'm setting none of these properties, as I'm doing
no downloads, and don't actually have a status bar to display the
security padlock. 

3. the same errors pop up in A2K, but the IE control steals the
keyboard focus, so it's no better than A97. 

4. the Gecko control works fine in A2K and A2K2 and doesn't steal
focus in either one. 

5. unfortunately, on first try, for some reason it's not honoring
the stylesheets. 

So, I have no good solution -- my client has, at best, A2K for one
machine and A2K2 for another. I wouldn't be bothered by installing
A2K on two machines because of the legal full A2K2 license. 

But that doesn't get me anywhere! If I use the IE control, I have
the error *plus* the stolen focus. 

On the other hand, if I upgrade and put A2K2 on both and use the iE
control, I get rid of the keyboard fucus stealing, but then have to
figure out how to get rid of the error in #2 above (Googling turns
up nothing for it in VBA, and very little elsewhere, either). 

So, looks like Gecko is the choice, since it works in both A2K and
A2K2, but I'll have to figure out why it's failing to honor the
stylesheet declarations (something IE is *not* having a problem
with). 

Well, after some digging around on Google Groups, I found this:

http://groups.google.com/group/alt.html/msg/b8394909038b2f04

and it says:

    Well, for what it's worth, I found the reason for this.  I
    discovered that it only happens after I add a <!DOCTYPE...> . 
    Mozilla then requires that the MIME type for the css be
    "text/css", and will not load if the MIME type is presented as
    "text/plain", which is what my localhost server is apparently
    serving up. 

Unless I can figure out a way to set a MIME type in Windows (without
running an HTTP server, that is), this is going to be a problem with
Gecko. I guess I can read the CSS stylesheet into a string variable
and write it in as an inline style declaration in the header of the
file I'm loading. Very messy, but better than nothing. 

My choices are not too good:

1. figure out how to make the Gecko control work in A97 -- not
bloody likely. 

2. figure out how to get rid of the IE errors in A2K2 -- not bloody
likely. 

3. use Gecko in A2K or A2K2 and bring all the style definitions
inline. 

So, I guess I can see what I have to do! But I'll have to convince
the client first. 

Anyway, I did a demo of the bug in A97. The MDB writes an HTML file
to the same folder it's in, and I am not including the CSS files, so
you won't see the pretty styling (Ha!). I've uploaded it here: 

  http://dfenton.com/DFA/download/Access/WebBrowserBug.zip

Others can check it out, but you'll see that the fields are
completely editable until such time as you put the focus on the web
browser control, which time you can't type into the fields any more. 

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
7/24/2007 11:59:40 PM
"David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
news:Xns9977CB654C26Cf99a49ed1d0c49c5bbb2@127.0.0.1: 

> Anyway, I did a demo of the bug in A97. The MDB writes an HTML
> file to the same folder it's in, and I am not including the CSS
> files, so you won't see the pretty styling (Ha!). I've uploaded it
> here: 
> 
>   http://dfenton.com/DFA/download/Access/WebBrowserBug.zip
> 
> Others can check it out, but you'll see that the fields are
> completely editable until such time as you put the focus on the
> web browser control, which time you can't type into the fields any
> more. 

Well, I've now found out that if I embed the web browser control
directly in my tab control, I have no problems with focus stealing. 

However, I have another problem that seems to be specific to my CSS
and HTML: 

When I use the web browser control directly embedded in the tab
control, it shrinks or grows every time the .Navigate method is
invoked. This may be because of workarounds in my CSS to avoid
problems that IE has with displaying horizontal scrollbars when
there is not need for it. I need the space so I can't turn on the
horizontal scrollbar all the time (as is the suggested preferred
solution), so instead I use the trick of setting negative margins,
like this: 

  BODY{right: -15px; margin-right: 20px;)

That gives you a net margin of 5 pixels.

But it seems that when I do that my web browser control shrinks or
grows by several pixels every time I load new content. 

But I can't recreate it!

I've tried setting the size before or after each navigation
operation, but that has no effect -- it stills shrinks/grows with
each document load. 

OK, I think there's something really weird about this ActiveX
control. When I recreated the control from scratch (instead of
cutting and pasting it from the existing control on the subform) the
growing/shrinking behavior has gone away. 

So, I've solved my problem *in Access97* (knock wood!).

The focus stealing was apparently something caused by being embedded
in a subform. 

The shrinking/growing was apparently a leftover behavior/property
from yesterday for some reason. 

So, I'm done! No conversion to a newer version of Access needed!

Of course, now that I've posted that, I'm sure it will go kaflooey.

But, I hope this monologue is now finished!

-- 
David W. Fenton                  http://www.dfenton.com/ 
usenet at dfenton dot com    http://www.dfenton.com/DFA/
0
David
7/25/2007 7:44:06 PM
Reply:

Similar Artilces:

Problem shortcuts in Word
Hello, I work with Word 2008. In the beginning there is no problem, but suddenly i have problem with shortcuts. When i want to do "cmd c" it make an other shortcuts same thing for "cmd s", "cmd v" and surly some other. But when i write there is no problem "c" is "c"... If somebody have an idea please help me. Thank you. Unless you indicate your specific update level of Office as well as OS X & describe what the keystrokes *are* doing contrary to what you expect there isn't much we can offer. -- Regards |:>)...

encoding problem in Outlook 2007 importing Outlook 2000 personal folders
I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese characters in the subject became unreadable but it's ok to display in message body. In Outlook 2000, there's no problem to display the Chinese characters in the subject. What's wrong with Outlook 2007? What setttings should I change to fix the problem? Thanks. cyl <u8526505@gmail.com> wrote: > I use Outlook 2007 to import the pst file of Outlook 2000. The Chinese > characters in the subject became unreadable but it's ok to display in > message body. In Outlook 2000, there's no problem t...

I want to expose Action menu items as form buttons
I'm trying to expose Action menu items as form buttons by customizing the _recources/ISV.Config file. I'm trying to use the following code: <incident> <ToolBar ValidForCreate="0" ValidForUpdate="1"> <Button Title="Resolve Case" ToolTip="Resolve this case" Icon="/_imgs/ico_18_serviceReports.gif" Url="http://localhost/CS/cases/dlg_closecase.aspx" PassParams="1" WinParams="" WinMode="0"/> </ToolBar> </incident> It throws an error, so I can only assume that I'...

Outlook 2003 PST problems
I just installed Office 2003 professional on a new computer & am having problems with outlook. I copied my Outlook.pst file into the appropriate directory & although it is recognized the calendar is not working properly. I cannot attach any of the colored labels to my appointments - so everything is pretty much in black & white. I totally uninstalled & reinstalled office... first removing my pst file... but there appears to be an ini file... or something that is retaining some information... does anyone know of a fix for the labels... or how to TOTALLY uninstall office (so I...

Problem with Authentication
The CRM application was running smooth. But now I can't logging. It ask my credentials and than return a 401.1 error. I had already reinstalled the CRM server but it won't work. I'm accessing it in the same local network. I'm running CRM 3.0 in SBS. Best regards, Erico Hi When you open a Internet explorer and type the name of the CRM server, it prompts for user and password ? Are you logged in with domain credentials ( AD user ) ? If you are, so add url of the crm server in Local intranet. Enable "Automatic logon only in intranet", this is under security,c...

Vista blue screen problem...please help!
I've seen some other threads, here are the dump files: 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' (http://rapidshare.com/files/347103149/Minidump.rar.html) Please, help me out here. -- ceVil It might be better to know at what point the bsod occurs and what the actual err.msg given is "ceVil" <guest@unknown-email.com> wrote in message news:0b9a0c60b90bf6c0be88bda30f2820ab@nntp-gateway.com... > > I've seen some other threads, here are the dump files: > 'RapidShare: 1-CLICK Web hosting - Easy Filehosting' > (...

calendar problem
Dear all, I am using both mail and calendar function in outlook 2002. Everything is ok until recently, when I try to make a new appointment or checking any old appointments, an error message "out of memory or resource, try to close some windows..." pop up. The mail function is still ok. Can anyone tell me how can I solve this? I have already installed sp2. The version of office is the professional one with frontpage. Thanks. tp ...

problem #4
Hi, I am facing this new problem... i.e a user has installed Office 2003 on win2k prof platform.. whenever she is working on a outlook.. she gets a Microsoft error message... saying to send the report or don't send the report... Usually I have seen this problem in IE... But for outlook it is new to me... after clicking on send or don't send report.. the outlook closes. And there are no IE open..... and if atall it is open.. the IE does not close... Need your help regards, KAH What is logged to the Event Viewer regarding this? Try one of the following already; http://www.howt...

95 and 97 problem
For some unknown reason there is Excel 95 and 97 on this pc.When i double click on an Excel file, the pc defaults to the 95 program (Which incidently doesn't work properly). So my question is how do i get the pc to default to 97. Cheers Craig Craig, Have a look at Windows Help. From Windows 2000 Help (Index under Programs Associating with File Types) To change which program starts when you open a file In My Computer or Windows Explorer, on the View menu, click Folder Options. Click the File Types tab. In the list of file types, click the one you want to change. Click Edit. In Act...

Date problem
I can't believe there's no post on this, but I can't find it. I've tried the solutions I could find (see below) and still get the error: "The expression is typed incorrectly or it is too complex to be evaluated. For example....Try simplifying...." I have a date field, formatted as Date/Time, General Date, default Value = Now(). I like having the date and the time - in case we need it. I want to run a report on calls taken just for one day. I have CallDate: CallDateAndTime in my query, with "criteria" as Between ([Forms]![frmReports]![txtStartDate]) A...

sync problems
I have all of my info on an HP Ipac. I had to reformat the hard drive and I did not make a back-up file. I am trying to move everything back to the computer but it says there is an error with syncing it. How can I move everything from the PDA back to Outlook again? Please help- thanks ...

Office 2007 - HELP
I have used Word for many years and love it - not too thrilled with the changes in Office 2007, but my bigger issue is with Publisher 2007. I have an image that I have used in Word just fine - meaning, the on screen colors are correct and when printed the colors are correct. Someone sent me a Publisher file and asked me to add the image - I did this - now the image is messed up - the colors are correct on screen, but when printed FROM MY computer the image colors are all wrong - but if I transport the file to a different computer it prints fine I have reinstalled Office - no good Any id...

Installation Problem!!
I am having a problem installing MSCRM 1.2. My configuration consists of a Domain Controller running Win 2000 Server SP4 . I am trying to install MSCRM on a member of the domain running Windows 2000 Server SP4. There is a DNS Server on the DC which is integrated with AD, and a SQL Server 2000 running on the Win 2K machine. The install errors out when CRM creates the root business with the message: Setup was unable to install Microsoft CRM Server. Setup was unable to provision your organization. Setup was unable to create the root business. The configuration of ASP.NET seems to be ok, the pr...

Problems Creating a disclaimer in Exchange 2003
I am trying to create a server based disclaimer that will stamp all of my smtp emails going to the internet. I have been following KB article 317680 with no luck. I get an error like the one below. Binding Display Name Specified: smtpscriptinghost ** Registration Failed ** Err.Number (HRESULT) = 0x1AD Err.Description = ActiveX component can't create object ProgID = cdo.ss_smtponarrival COM Category = {FF3CAA23-00B9-11d2-9DFB-00C04FA322BA} Corresponding Event = onarrival ** Have you registered your sink COM class on this machine? I am puttin...

Resource editor problems
Hello all, Under VC++ 7.1... Please consider these two lines: IDC_ARROW_ADD_CANCEL DISCARDABLE "res\\cur00004.cur" IDC_ARROW_ADD_CANCEL CURSOR DISCARDABLE "res\\cur00004.cur" The second is a hand-edited change to the first. Both will compile just fine in the resource compiler. However, after I use a text editor to make this change, I cannot open the .rc file in the resource editor. The resource editor issues the following error open attempting to open the .rc file: error RC2135 : file not found: CURSOR Can anyone shed light on what's going on here? Thanks, Dave ...

Directory Replication Problem #2
Hi, recently my Exchange Server directory database receives changes from other servers but does not send out its own changes. Check from the knowledge base, to correct the USN discrepancy need to use Authrest.exe (need to amke changes for about 100+ users). Does anybody know where to get this file 'Authrest.exe' for exchange server 5.5? Exchange server 5.5 CD only provide this file for ver.4.0. Have anyone use it before? Regards, "Sharon Tan" <sharon_tansk@yahoo.com.sg> wrote: >Hi, recently my Exchange Server directory database >receives changes from ot...

Cell Format
I have a spreadsheet with cells that I'm trying to type the date into. I type in the date exactly like this: 09/26/03. When I hit "enter" MS Excel displays "37890" in the cell. No matter what I do I can't the cell to show: 09/26/03. I think that somehow I need to "strip" the cell of what it's original format is, but I can't figure out how. I try to use the Date option in the format cell screen but it doesn't work. Curtis I tried this and it didn't work. I also tried the "Text to columns" feature. No success. >...

User Defined Variables in MS query cause a problem to import data
If I use user defined variables in MS query to import data into excel sheet, the query executes but no data gets imported into the excel sheet. If I get rid of the variable the results can be imported into the Excel sheet. ...

outlook web access redirect problem
hi, I have been trying to redirect outlook web access (OWA) from the IIS root folder to the /exchange folder. I have followed the instructions on going into the web site and redirecting to a folder but I just get the following URL when I browse to the root of my webserver : http://webmail/exchange/exchange - it's like it's doubling up somehow. I have it set to : A redirection to a URL redirect to: /exchange client will be sent to: A directory below URL entered I just can't work it out... any ideas... cheers Baronne Which instructions did you follow? I wrote the below articl...

Problem after sorting
In my Excel 2007 workbook I have two sheets The "Master Names" sheet has columns: (A) First|(B) Last (C) First (B) Last (concatenated) The "Selected Names" sheet contains (A) cells which link to selected (C) First Last (concatenated) cells in the Master Names sheet. Everything links and displays fine except when I add names to the bottom of the Master Names sheet and then sort using (B) Last name column. When I do this I get a 0 (zero) in the (A) First Second cells in the Selected names sheet and other cells in this sheet have the wrong name. Obviously I am doin...

Adding textboxes based on what user inputs in Total Students textb
Hi All, How can I add text boxes on the form based on what user inputs in a textbox? For eg: I have a textbox "Total Students" , so Once I input a number in that textbox, I want to have that many textboxes on the form. If I input 4 I want four textboxes to be displayed on the form. In addition to this: I want all this textboxes to be displayed in a specific frame, I have made this frame as "vertically scrollable" as I have limited space on my form and want to fit in as many textbo, Is there a way to do this? Thanks in advance ...

IF AND problem
Need to isolate problems on 1600 rows Worksheet Row Dept Hrs. Dollars A5 120500 600 9000 A6 120600 400 8000 A7 130600 240 A8 130400 160 A9 140600 320 6400 A10 140200 100 2000 A11 140600 240 (Found out the dept has 2 leading blanks) Isolate problems on 0600 criteria pointing out when b has value and c = 0. OK if both are 0. A7 and A11 should stand out.. =IF((MID(A1,5,4)="0600")=AND(b1>=0=AND(c1>=0)),"NO","ok") Does this work for you: =IF(RIGHT(A...

Problem SHAppBarMessage
Hi, I am creating an application bar which shall be displayed always at the top of the screen to show the user certain alerts. I am using the commands SHAppBarMessage(ABM_NEW, &abd); SHAppBarMessage(ABM_QUERYPOS, &abd); SHAppBarMessage(ABM_SETPOS, &abd); SetWindowPos(NULL, abd.rc.left, abd.rc.top, abd.rc.right - abd.rc.left, iClientHeight, SWP_NOACTIVATE); Works fine. The problem begins, when I start moving the taskbar. I am catching the event OnSettingChange and my application bar is resizing/moving correctly. BUT: If the taskbar moves to the top and my application bar ...

Lookup() problem
I set up two lists, 200 employees names and 200 employee numbers. A couple of the numbers match the correct names but the rest of the numbers all pull the same employee name. =LOOKUP(C4,List!C4:C204,List!B4:B204) The first time I tried it seemed to pull the correct matching names and numbers then kabui it gets stuck. I tried deleting the entire lists cells and all and starting over but same thing. Anyone ever run into this before? Wayman Don't forget! When using Lookup(), the vector (second argument) must be sorted in ascending order. If it's not, you'll get what you ca...

Problem creating credit card account
When creating a Chase or Amazon.com credit cards I am having this happen to me when it creates the card and I can't figure out how to fix it so there is just one card showing. I attached a jpeg of what I am seeing. It's like it created multiple instances of the card and also show balances of my other cards. I am not sure if it is because these cards are associated with Chase or what. When I had it setup the online service for the card then that is when it creates the other instances. I hope someone can makes sence of this. Thanks! ...