Equivalent to VBA's .SetFocus

G

Guest

They couldn't have done away with how to setfocus to a control...

like in response to an incorrect value input to a textbox...

If Not IsDate(txt_DOB) then
txt_DOB.SetFocus
End If

How do I do that?
 
K

Karl Seguin

you do this in javascript via the focus() function.

<input type="text" id="XXX">

<script language="JavaScript">
document.getElementById("XXX").focus();
</script>

Karl
 
G

Guest

Is there a VB.NET or VB Script version?

Karl Seguin said:
you do this in javascript via the focus() function.

<input type="text" id="XXX">

<script language="JavaScript">
document.getElementById("XXX").focus();
</script>

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top