473,566 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setfocus ready for typing?

How can I set up a command button that will setfocus on a specific field
that may or may not contain info already and be ready for the user to start
typing. My command button is set right now, that when clicked...
Me.MyFieldName. Setfocus...but if there is data in that field already, the
info is highlighted so if the user begins typing it will overwrite the
current data.
Mar 4 '07 #1
3 1579

"Jimmy" <do**@email.mes chreef in bericht news:OZ******** ********@fe06.n ews.easynews.co m...
How can I set up a command button that will setfocus on a specific field
that may or may not contain info already and be ready for the user to start
typing. My command button is set right now, that when clicked...
Me.MyFieldName. Setfocus...but if there is data in that field already, the
info is highlighted so if the user begins typing it will overwrite the
current data.
Look at the Selstart and SelLengthproper ties

Arno R
Mar 4 '07 #2
This will cause the cursor to move to the end of existing text anytime the
control is entered. I always use this on any control where accidental
overwriting of data would be a problem.

Private Sub MyFieldName_Got Focus()
MyFieldName.Sel Start = Len(Me.MyFieldN ame)
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200703/1

Mar 5 '07 #3
"Jimmy" <do**@email.mew rote in message
news:OZ******** ********@fe06.n ews.easynews.co m...
How can I set up a command button that will setfocus on a specific field
that may or may not contain info already and be ready for the user to
start typing. My command button is set right now, that when clicked...
Me.MyFieldName. Setfocus...but if there is data in that field already, the
info is highlighted so if the user begins typing it will overwrite the
current data.
Go to the Keyboard tab in Tools/Options and select the "go to end of field"
option.

Keith.
www.keithwilby.com
Mar 5 '07 #4

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

Similar topics

26
2448
by: Simon | last post by:
I'm doing a survey. When do you think GNU/Linux will be ready for the average Joe? What obstacles must it overcome first?
7
3301
by: Anthony Hendrata | last post by:
Hello All, I know this may be easy for some people, but I need some help on a little programming. I have this application that has been developed in Access, there is a textbox call FindByName and a command button called cmdFilter. What I would like to do is that when a user begins typing in the textbox, that the focus would be on the...
4
9672
by: Mad Scientist Jr | last post by:
i am trying to set focus to a specific control depending on the outcome of a validator control and it is not working. none of these methods are working to setfocus: 1. RegisterStartupScript("sf","<scriptlanguage='javascript'>document.form.MyControlID.focus();</script>"); 2. Andy Smith's FirstFocus control from...
0
1516
by: MrsLeigh | last post by:
I have a datagrid on a web page. In the footer there is a field that should be recieve the focus, either at the start or after a button is clicked to insert the row that is being added in the footer. I created the following Sub... Private Sub SetFocus(ByVal ctrl As Control) Dim SetFocus As String = "<script...
3
6663
by: Jim Devenish | last post by:
In my application vehicles arrive and depart from a workshop. The ArrivalDate and the HandoverDate are each entered. Sometimes the person who should enter the arrival date forgets to do so. When the vehicle is handed over to the customer and the HandoverDate is entered I wish to warn about the possibly missing ArrivalDate. In the...
4
2636
by: =?Utf-8?B?am9zZXJhbW9uYnJhdm8=?= | last post by:
I use a CDialog with several controls and I want to set the focus in one of them , a CEdit, when an instance is created. The trouble is that I can get a pointer to the CEdit window, say p, but if I use the code p->SetFocus(); then a warning about a fatal error " memory that can't be read " is issued and application is killed. I've tried...
5
3267
agroover
by: agroover | last post by:
I can't seem to figure out how to get rid of the errors. I recieve the following error when I leave the Grade.SetFocus in my code... Microsoft Access can't move the focus to the control Grade GRADE.SetFocus - Highlighted when I hit debug on the error message Private Sub C_Click()
4
16305
by: Michael R | last post by:
Hi everyone. I wanna say first, I appritiate a lot the fact that I'm able to ask questions here! I have a form with a textbox that if its value equals to a certain condition, a command button appears next to it. After the command button appears I need the cursor to go back to the last letter of the textbox so that the user could continue...
6
4474
by: Whizzo | last post by:
Hi folks; I spent a little while some time ago building a touchscreen data entry interface into an Access 2003 form. I'm not too experienced in VBA at all so I was quite happy when I came up with a reasonably elegant solution, especially given that there's multiple text boxes involved. Each of the "keys" on the screen keyboard is a cmd button...
0
7893
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8109
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...
0
6263
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
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...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2085
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1202
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
926
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...

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.