+ Reply to Thread
Results 1 to 7 of 7

Need to copy text in a textbox with a control button

  1. #1
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    Need to copy text in a textbox with a control button

    I’m a research coordinator for a neurosurgeon and I’m trying to create a research database in Access 2003 using data from a bunch of old Excel worksheets that he has lying around. Once it’s up and running, the data in the Access database will have to be updated on a regular basis. This may require looking up 100-150 patients a day in the hospital’s computer system.

    The hospital’s system requires the patient’s name to be entered all on one line: last name, first name middle initial. I ’ve created text box on my data entry form that arranges the patient’s name in that order. In order to look up a patient’s record I have to click on the combined name textbox, highlight the text, and hit ctrl-c. I then plunk it into the name field in the hospital’s system using ctr-v and hit enter

    What would really speed things up is if I had a control button that when I clicked on it the text in the combined name textbox would be copied to the clipboard all in one motion. I’ve created the control button, but I have no idea how to write the macro or whatever that will control it.

    I’ve attached a sample database so you can see what I’m talking about. Thanks.
    Attached Files Attached Files
    Last edited by Research RN; 08-04-2009 at 04:33 PM.

  2. #2
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    Re: Need to copy text in a textbox with a control button

    As far as I know you will need to use the Windows API to use the clipboard - Whether or not I am right here is an example http://www.mvps.org/access/api/api0049.htm

  3. #3
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    Re: Need to copy text in a textbox with a control button

    Quote Originally Posted by darbid View Post
    As far as I know you will need to use the Windows API to use the clipboard - Whether or not I am right here is an example http://www.mvps.org/access/api/api0049.htm
    You're going to have to be patient with me. I'm just a nurse. What is Windows API? How do I use the code in the link you gave?

    Thanks

  4. #4
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    Re: Need to copy text in a textbox with a control button

    Quote Originally Posted by Research RN View Post
    You're going to have to be patient with me. I'm just a nurse. What is Windows API? How do I use the code in the link you gave?

    Thanks
    Oh well....

  5. #5
    Registered User
    Join Date
    10-04-2008
    Location
    uk
    Posts
    26

    Re: Need to copy text in a textbox with a control button

    Hi

    maybe this will work for you

    Enter the following on the click event of the Copy Button

    Please Login or Register  to view this content.

    This moves the focus back to the combined name text box and then copies it.

    You should then be able to paste into another application. I only tested with Excel, Notepad and Google but it seems to work.


    good luck
    qff

  6. #6
    Registered User
    Join Date
    11-09-2008
    Location
    germany
    Posts
    74

    Re: Need to copy text in a textbox with a control button

    Quote Originally Posted by Research RN View Post
    I'm just a nurse.
    Only cause you wrote this.


    see the attached. Now once you click your button. Whatever is in text13 will be saved to your clipboard and ctrl v will then paste it where you want.


    You should also note there may be simpler ways of doing it.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-07-2008
    Location
    St. Louis, Missouri, USA
    MS-Off Ver
    2003
    Posts
    50

    Re: Need to copy text in a textbox with a control button

    Quote Originally Posted by darbid View Post
    Only cause you wrote this.


    see the attached. Now once you click your button. Whatever is in text13 will be saved to your clipboard and ctrl v will then paste it where you want.


    You should also note there may be simpler ways of doing it.
    That is brilliant! Thanks so much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1