Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access 2007 - VB code

Posted on 2014-12-27
7
Medium Priority
?
113 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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
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.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

604 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