DrewDog_21
Mar 16th, 2001, 08:59 AM
How do you set the focus to a control in vbScript?
My code here doesn't seem to like the line TheForm.InHouse.SetFocus
<SCRIPT LANGUAGE="VBSCRIPT">
<!-- hide script from older browsers
Sub cmdSubmit_OnClick
Dim TheForm
Set TheForm = Document.forms("frmSubmit")
If TheForm.InHouse.Value = "" Then
MsgBox "Please enter a value for In House", 0, "Census Report"
TheForm.InHouse.SetFocus
Else
TheForm.Submit
End If
End Sub
-->
</SCRIPT>
My code here doesn't seem to like the line TheForm.InHouse.SetFocus
<SCRIPT LANGUAGE="VBSCRIPT">
<!-- hide script from older browsers
Sub cmdSubmit_OnClick
Dim TheForm
Set TheForm = Document.forms("frmSubmit")
If TheForm.InHouse.Value = "" Then
MsgBox "Please enter a value for In House", 0, "Census Report"
TheForm.InHouse.SetFocus
Else
TheForm.Submit
End If
End Sub
-->
</SCRIPT>