Adding code to KeyPress in DOM prevents letters from being displayed in INPUT control (text).

Here is the situation.  I have a VB 6.0 app that accesses the DOM of an open IE Window (I'm not using the WebBrowser control, just the MS HTML Object Library - mshtml).  I'm capturing the events of the DOM and adding items to a ListBox control.  However, it doesn't seem to matter even if there is no code in the procedure:

Private Function md_onkeypress() As Boolean
    'lstEvents.AddItem "d_onkeypress"
End Function

md is an HTMLDocument object from an IE Window.  The only way that it will allow me to type certain charaters is to totally comment out the entire event procedure.  It won't even work with the lstEvents.AddItem "d_onkeypress" code commented out.  However, the backspace key does work.

I appreciate any help you can give me!

Thanks,
Scott
LVL 1
scottmichael2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AzraSoundCommented:
return true from the event procedure, e.g.,

md_onkeypress = true

at the end of the function.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
scottmichael2Author Commented:
Thanks, that worked perfectly!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.