' script in the Body document ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ' add new variable to make the textbox reference visible outside of the Body document function Dim textBoxToReceiveFocus Set textBoxToReceiveFocus = Nothing ... ... ' here is your function in the Body document Function ... ... ... Set textBoxToReceiveFocus = <I>referenceToTextbox1</I> window.setTimeout "textBoxToReceiveFocus.focus()", 100 ' instead of just <I>referenceToTextbox1</I>.focus() End FunctionHope this helps.