Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB Form field highlighting

I am using a VB Form to allow a barcode to be scanned into a text box and
then various other actions take place. This is the only input field on the
screen. All others are display only. The problem I have is that after the
barcode is scanned, the cursor remains at the end of the scanned number. I
would like the whole field to be selected (highlighted) so that I can then
scan another number to overwrite the previous one. One possibility is to make
the cursor tab to another field and then back again but this is outside of my
ability.
I'm using VBA that comes with excel 2003. (6.3)I think
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default VB Form field highlighting

Private Sub CommandButton1_Click()
TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1)
TextBox1.SetFocus
End Sub

While I have put this in a commandbutton, it isn't clear how you would need
to trigger it. Surely something happens after the barcode is scanned in or
does someone just look at the userform? (how are other controls populated?)

--
Regards,
Tom Ogilvy

"wonky muffin" <wonky wrote in message
...
I am using a VB Form to allow a barcode to be scanned into a text box and
then various other actions take place. This is the only input field on the
screen. All others are display only. The problem I have is that after the
barcode is scanned, the cursor remains at the end of the scanned number. I
would like the whole field to be selected (highlighted) so that I can then
scan another number to overwrite the previous one. One possibility is to

make
the cursor tab to another field and then back again but this is outside of

my
ability.
I'm using VBA that comes with excel 2003. (6.3)I think



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Active X Controls Tabbing from Form Field 2 Form Field Tfrup12 Excel Discussion (Misc queries) 0 February 19th 08 08:15 PM
keyboard short cut for highlighting a field Cindy Excel Worksheet Functions 5 January 18th 08 01:36 AM
Summary field highlighting. Bill Excel Discussion (Misc queries) 0 August 30th 06 10:39 PM
How do I set up excel to tab from field to field in a form? bigmac6365 Excel Discussion (Misc queries) 2 September 30th 05 08:32 PM
Highlighting Textbox1 Value when form initializes. Todd Huttenstine[_3_] Excel Programming 2 November 26th 03 10:35 PM


All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"