473,721 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.SetFocu s
End If

How do I do that?
Dec 15 '05 #1
4 1397
you do this in javascript via the focus() function.

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

<script language="JavaS cript">
document.getEle mentById("XXX") .focus();
</script>

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

"jonefer" <jo*****@discus sions.microsoft .com> wrote in message
news:DF******** *************** ***********@mic rosoft.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.SetFocu s
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="JavaS cript">
document.getEle mentById("XXX") .focus();
</script>

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

"jonefer" <jo*****@discus sions.microsoft .com> wrote in message
news:DF******** *************** ***********@mic rosoft.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.SetFocu s
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*****@discus sions.microsoft .com> wrote in message
news:DF******** *************** ***********@mic rosoft.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.SetFocu s
End If

How do I do that?

Dec 15 '05 #4
2.0 provides SetFocus method.

Eliyahu

"jonefer" <jo*****@discus sions.microsoft .com> wrote in message
news:DF******** *************** ***********@mic rosoft.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.SetFocu s
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
9681
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 you type text in the textbox. Greetings, Hans
4
65643
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 a record inserted into the subform's table, with date created and some information from the main table inserted into the proper fields in the subform. After the record is inserted, the data entry operator enters a Date Of Service and a billing...
6
10232
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 that I reference this button in VBA code, the Visual Basic Editor capitalizes the P changing btnAlbumUp.SetFocus to
3
1772
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 field) I have a form which is NOT BOUND to this table with following controls
0
1184
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 anything on it. if i start the form itself it says "cannot jump to this data record" and if i debugg it stops at the marked line. the guy who wrote it told me it was working... Option Compare Database Option Explicit
2
11905
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 show database window from VBA in opening Access project? Any ideas?
1
3823
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 get validated. All of that works fine. However, I want to allow for the condition that a user opening the form doesn't want to complete it. They have the option of pressing the CANCEL button on the form. The problem is that even though I have...
2
16667
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, one sub). That code is working properly. How do I get that to translate to my report? I use VBA code because I use formats other than BMP for the pictures. Would basing the form on the qury that the report is based on solve the issue without...
8
13742
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 cannot be null. So I written a function to validate the field which is shown below, If I write before update on Order_comp_date field then I get run time error message : You must save the field before you execute setfocus method Private Sub...
0
8837
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8728
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9130
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9059
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6668
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5977
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4751
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2129
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.