473,411 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Equivalent to VBA's .SetFocus

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?
Dec 15 '05 #1
4 1386
you do this in javascript via the focus() function.

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

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

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"jonefer" <jo*****@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
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?

Dec 15 '05 #2
Is there a VB.NET or VB Script version?

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

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

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

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

"jonefer" <jo*****@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
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?


Dec 15 '05 #3
Here's how you set the focus to a control:
http://SteveOrr.net/faq/2in1.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"jonefer" <jo*****@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
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?

Dec 15 '05 #4
2.0 provides SetFocus method.

Eliyahu

"jonefer" <jo*****@discussions.microsoft.com> wrote in message
news:DF**********************************@microsof t.com...
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?

Dec 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: avocursist59lok1 | last post by:
Hello, I'm busy with VBA in excel. Does anybody know how to control the input within a textbox? For example, a textbox must contain only numbers and no text. The program must give a warning if...
4
by: YFS DBA | last post by:
How do I use VBA to insert a *new* record into a subform? I have a master form with client information, and a sub form with billing information. I want to click on a button ("Add Data") and have...
6
by: Corepaul | last post by:
I am new to Access 2000. My operating system is Windows 2000. In the early stage of development I noticed something weird. On my form, I have a Command Button named "btnAlbumUp". The first time...
3
by: Hasanain F. Esmail | last post by:
Hi, Your help will be greatly appriciated. I have a table with following fields. Table's name is tblTicketNumers TicketNumberID (It is a key field) TicketNumber (Text field) AgentsName (Text...
0
by: reini | last post by:
i have a problem with an db&vba which was written by someone else, but i have to work on it now. there is a form opened by a vba and instead of the form there is only a white/grey form without...
2
by: Len4ik | last post by:
If I open Microsoft Access project without database window, how can I show it from VBA? I don't use startup option "Show database window". In the project disable option "special key". How can I...
1
by: GreggaR0und | last post by:
Hi; I am writing VBA in Word. The application is that a Userform opens up from a template in order to acquire user input for the remainder of the form. The Userform has three fields which then...
2
by: smorrison64 | last post by:
I have a form that is coded to open a File Dialog boc to pick a picture to display on that particular item on a subform. My form is not based on query, but rather two separate tables (one primary,...
8
vs2k8
by: vs2k8 | last post by:
Hello guys, New to this forum and new to access programing, my issue is I am comparing 2 date fields, I have to validate that Order Rcvd Dt should be less then Ord Comp date and Order Comp date...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.