473,499 Members | 1,658 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 1568

"Jimmy" <do**@email.meschreef in bericht news:OZ****************@fe06.news.easynews.com...
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 SelLengthproperties

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_GotFocus()
MyFieldName.SelStart = Len(Me.MyFieldName)
End Sub

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

Answers/posts based on Access 2000

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

Mar 5 '07 #3
"Jimmy" <do**@email.mewrote in message
news:OZ****************@fe06.news.easynews.com...
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
2433
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
3292
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...
4
9663
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....
0
1507
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...
3
6650
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. ...
4
2620
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...
5
3262
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 ...
4
16286
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...
6
4462
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...
0
7132
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,...
0
7178
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,...
1
6899
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
7390
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...
0
4602
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...
0
3103
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...
0
3094
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
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 ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.