PDA

Click to See Complete Forum and Search --> : set focus


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>

DrewDog_21
Mar 16th, 2001, 09:10 AM
Never mind, I found it. It should have been
TheForm.InHouse.Focus()

This and other little differences between VB and vbScript have been driving me apesh!+. Does anyone know where I can find a good outline of the differences between the two?