473,396 Members | 2,013 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,396 software developers and data experts.

Data Entry

Objective : The user requires to enter data into a text field without having to highlight it before typing over what was there before. This works if the user uses the up/down key to go to the next record, but when they use the mouse to go to a specific row I'm trying to find a way of highlighting that field (ie in reverse video). I've tried using the code: SendKeys "+^{RIGHT}" in the 'OnFocus' event but to no avail.
Aug 8 '08 #1
2 972
hjozinovic
167 100+
Hey Mallard!

You can use this code in the control's OnClick event:
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtSearchString_Click()
  2. Me.txtSearchString.SelStart = 0
  3. Me.txtSearchString.SelLength = Len(Nz(Me.txtSearchString, 0))
This way when you click on that control (txtSearchString in my example)
the content of the control is selected and you can type over it.
Note that Nz(ControlName,0) is used in order to avoid err when control is empty (null).
Hope it helps, H.
Aug 8 '08 #2
NeoPa
32,556 Expert Mod 16PB
That should work - except possibly change the third line so that Nz() uses "" if value Null instead of 0.
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtSearchString_Click()
  2. Me.txtSearchString.SelStart = 0
  3. Me.txtSearchString.SelLength = Len(Nz(Me.txtSearchString, ""))
  4. ...
Or why not use the With construct to make the code more efficient and easier to read :
Expand|Select|Wrap|Line Numbers
  1. Private Sub txtSearchString_Click()
  2. With Me.txtSearchString
  3.   .SelStart = 0
  4.   .SelLength = Len(Nz(.Value, ""))
  5. End With
  6. ...
Aug 9 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: lawrence | last post by:
I had some code that worked fine for several weeks, and then yesterday it stopped working. I'm not sure what I did. Nor can I make out why it isn't working. I'm running a query that should return 3...
3
by: | last post by:
Hi, I am an intermediate computer science student and I am in need of a "macro type" tool/language that will let me automate a data entry process. The data entry is rather simple but requires...
0
by: tamilan71 | last post by:
Can anyone tell me a simple method of creating an application in Access 2003 that uses "Double data entry"? For me double data entry is defined as the ability to have data entered twice. The first...
16
by: jhwagner | last post by:
I need to use double data entry with an MS Access database. I have read many arguments and reasons against this on this group but I have to do this. I have seen various tips on how this can be...
3
by: bosmatthews | last post by:
I have a main form with a subform and a second subform nested to the first subform. The data entry property for all three forms (main, subform and sub-subform) is set to "yes" because I am intending...
20
by: hippomedon | last post by:
Hello everyone, I'm looking for some advice on whether I should break the normalization rule. Normally, I would not consider it, but this seems to be a special case. I have created an...
5
by: Anan18 | last post by:
Hello sir, I'm supposed to Implement and Test the sequence Class Using a Fixed-Sized Array (Chapter 3), from Data Structures & Other objects using c++. The header file is provided, and so is a test...
1
by: admin.offshoredataentry | last post by:
Data Entry Outsourcing provides time bound, cost effective and qualitative Data Entry also provides numeric data entry, textual data entry, image data entry, data format, data conversion and also...
1
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading...
0
by: dataentryoffshore | last post by:
Get a Discount up to 60% on data entry, data capture, dataentry services, large volume data processing and data conversion services through offshore facilities in India. Offshore data entry also...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...

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.