?
Solved

Access 2007 - VB code

Posted on 2014-12-27
7
Medium Priority
?
112 Views
Last Modified: 2015-01-01
My OS is win 7 Prof 64 bit and I use office 2007.  In my Access 2007, I have the following code :
Private Sub cmdCopy_Click()
' This procedure runs when the Copy button is clicked.
On Error GoTo Err_cmdCopy_Click

    ' Set focus on the results.
    Me.txtResults.SetFocus
    
    ' Copy the results to the clipboard.
    DoCmd.RunCommand acCmdCopy

Exit_cmdCopy_Click:
    On Error Resume Next
    Exit Sub
    
Err_cmdCopy_Click:
    MsgBox Err.Number & " " & Err.Description, vbCritical, "cmdCopy_Click"
    Resume Exit_cmdCopy_Click
End Sub

Open in new window

but when the button is clicked, it does not seem to  highlight all the text, it flickers before the start of the first character as the highlighting is from right to left, and sometimes I wonder if all the text have been selected.  
Is there any sure thing to do in code, that will highlight all the text, without any reasonable doubt?.
0
Comment
Question by:jegajothy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 40519639
try

Me.txtResults.SetFocus
Me.txtResults.SelStart=0
Me.txtResults.SelLength = Len(Me.txtResults.Text)

   ' Copy the results to the clipboard.
     DoCmd.RunCommand acCmdCopy
0
 

Author Comment

by:jegajothy
ID: 40520060
No objections from me.  Thank u.
0
 

Author Comment

by:jegajothy
ID: 40526662
I've requested that this question be deleted for the following reason:

It is been moved to a different category where it has been answered. thank u.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40526663
would you mind posting the solution here?
0
 

Author Closing Comment

by:jegajothy
ID: 40527003
works.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question