Results 1 to 3 of 3
  1. #1
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71

    Form Field data selected, how do I deselect in a macro

    Field 1= Bobisyour\Uncle\ (this text was pasted into this field)
    Field 2= WhoIsBob (This field comes from another field and is now in the clipboard)

    I am going to field 1 and pasting this information "Bobisyour\Uncle\" then using gotocontrol I goto field 2 and copy the text into the clipboard "WhoIsBob". Then using gotocontrol I go back to field 1 and paste "WhoIsBob" at the end of the existing text and ending up with "BoBobisyour\Uncle\WhoIsBob". I do not know how to go to the end of the text in the field to paste the new text from field 2. When I enter the field the text it is always automatically selected, I want to deselect it automatically and go to the end of the text. I can manually go to the end of the text by simply clicking at the end of the text and then pasting, but would rather automate it in a macro.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    'Just take the two values and re-assign
    Code:
    txtField2.setfocus
    DoCmd.RunCommand acCmdPaste     'paste the value
    
    txtField1 =txtField1 & txtField2

  3. #3
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71
    This worked perfectly, thank you very much. I would like to move the focus to another field in the form. Instead of creating a macro to do that I thought I would ask for the code and just put in this Event procedure. Im in field1 and I want to go to Field2

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 09-16-2014, 02:35 PM
  2. Replies: 1
    Last Post: 07-26-2013, 12:10 PM
  3. Replies: 7
    Last Post: 05-01-2012, 11:43 AM
  4. Export selected data from form
    By siedne in forum Forms
    Replies: 1
    Last Post: 12-01-2011, 05:48 PM
  5. Autofill a field once a Form is Selected from Switchboard
    By AccountingStudent in forum Forms
    Replies: 3
    Last Post: 09-13-2011, 11:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums