Results 1 to 2 of 2

Thread: set focus

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Question

    How do you set the focus to a control in vbScript?
    My code here doesn't seem to like the line TheForm.InHouse.SetFocus
    Code:
    <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>

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width