Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Sun Mar 4 13:35:24 CST 2007
I found this solution on the web and it works. Key was to define the text box as a control. But it there a simpler way? Rocky Public Sub AutoSelectText(EditControl As Object) 'Defining edit control as object 'lets you do this with any control that 'supports SelStart and SelLength On Error GoTo ErrorHandler Dim lTextLength As Long lTextLength = Len(EditControl.Text) If lTextLength Then EditControl.SelStart = 0 EditControl.SelLength = lTextLength End If ErrorHandler: Exit Sub End Sub 'Call AutoSelect Text in the GotFocus 'Event of your TextBox Private Sub Text1_GotFocus() AutoSelectText Text1 End Sub -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at Beach Access Software Sent: Sunday, March 04, 2007 11:20 AM To: 'Access Developers discussion and problem solving' Subject: [AccessD] Simple Sunday Question Can't seem to get this behavior. When a bound text box get the focus I want all the data in the box to be selected so the user doesn't have to. What's the syntax? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.6/709 - Release Date: 3/3/2007 8:12 AM