textbox loosing focus
-
txtFind is a textbox that is used for search purposes (ie if a value is entered and the text box looses focus, a grid appears displaying a range of results). However, if no value is entered and it looses focus, i want the focus to be set on another text box: If txtFind.Text = "" Then txtCustomerCode.SetFocus Exit Sub End If However, this generates the error: "Invalid procedure call or argument", is there anything i can do to alleviate this? thanks in advance for any help!let me know if any additional detail is required.
-
txtFind is a textbox that is used for search purposes (ie if a value is entered and the text box looses focus, a grid appears displaying a range of results). However, if no value is entered and it looses focus, i want the focus to be set on another text box: If txtFind.Text = "" Then txtCustomerCode.SetFocus Exit Sub End If However, this generates the error: "Invalid procedure call or argument", is there anything i can do to alleviate this? thanks in advance for any help!let me know if any additional detail is required.
Hi ! I get this same error when the control to which I want to set the focus is not visible. Jerome
-
txtFind is a textbox that is used for search purposes (ie if a value is entered and the text box looses focus, a grid appears displaying a range of results). However, if no value is entered and it looses focus, i want the focus to be set on another text box: If txtFind.Text = "" Then txtCustomerCode.SetFocus Exit Sub End If However, this generates the error: "Invalid procedure call or argument", is there anything i can do to alleviate this? thanks in advance for any help!let me know if any additional detail is required.
First of all, make sure you have another Control that can get Focus (i.e. It must be Enabled and if there is an "AllowFocus" property, set it to true). Then in the Validate Event: If (txtFind.Text.Length = 0) Then txtNext.Focus():Exit Sub 'Otherwise, populate Grid Here