MS Access Forms WebBrowser Control Focus/Unfocus Problem
Posted on 2013-06-22
The situation is this: I have a simple MS Access (2010/13) Form (frm_AttachInstrType) that has as one of its controls a WebBrowser (WebBrowser4). The Webrowser control's source is a string containing variables that determine which PDF file in a specific directory is displayed when the form moves through the records, i.e. moving to the next record on the form will cause a different PDF file to be displayed in the WebBrowser Control. (This part all works just fine, BTW.)
My problem is this: When all elements of the parent form (frm_AttachInstrType) have finished loading (including the WebBrowser control) I want to set focus on a Text Box (txt_SelectInstrType) on the Parent Form to receive data input from the user....BUT....focus always ultimately lands on the WebBrowser control.
I have tried placing a Me.txt_SelectInstrType.SetFocus statement in about 10 different places/events (on both Parent Form and WebBrowser Control) and I still can't get the focus to the txt_SelectInstrType after the form loads. This doesn't sound like much, but given my particular application it will save literally thousands and thousands of keystrokes.
Thanks in advance for any help.