Go Back   Access World Forums > Microsoft Access Discussion > Modules & VBA

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 02-15-2001, 11:07 AM   #1
Talismanic
Senior Member
 
Join Date: May 2000
Location: Three Rivers, MI
Posts: 377
Thanks: 0
Thanked 0 Times in 0 Posts
Talismanic
Select text in Access like Visual Basic

I am trying to get the text in a control to be selected when the user enters the box so that the user can enter a new number without deleting the text allready in the box.

Here is the code:

Private Sub txtEmployeeNumber_GotFocus()
txtEmployeeNumber.SelStart = 0
txtEmployeeNumber.SelLength = Len(txtEmployeeNumber.Text)
End Sub

This should work but it isn't. I am using this in a combo box, could that be the problem. If so, how do I do this?

__________________
The ever increasingly inaccurately named
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Board List for PC Support.
Talismanic is offline   Reply With Quote
Old 02-15-2001, 11:37 AM   #2
Rich
Guest
 
Posts: n/a
Can't you just use select entire field on entry in options?
  Reply With Quote
Old 02-15-2001, 11:42 AM   #3
Talismanic
Senior Member
 
Join Date: May 2000
Location: Three Rivers, MI
Posts: 377
Thanks: 0
Thanked 0 Times in 0 Posts
Talismanic
It is set that way and it does do it on the form load and open but I want it to do it every time the control gets focus.

__________________
The ever increasingly inaccurately named
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Board List for PC Support.
Talismanic is offline   Reply With Quote
Old 02-16-2001, 11:11 AM   #4
Talismanic
Senior Member
 
Join Date: May 2000
Location: Three Rivers, MI
Posts: 377
Thanks: 0
Thanked 0 Times in 0 Posts
Talismanic
Anyone?

__________________
The ever increasingly inaccurately named
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Board List for PC Support.
Talismanic is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 09:41 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World