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

    Using the Clipboard in a Macro in a form

    I used to be able to do this in previous versions of office (DoMenuItem \ Copy or Paste). This is what I'm trying to do: Create a button with an event behind it that will when I press the button go to a control (field) in what ever record I am currently in. Copy the text in the control\field go to another control in that same record and paste the information into that field or control. It used to be quite simple and worked really well for what I am trying to do, I just cant find anything in the macro menus. Any help would be appreciatted

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Would you like to consider doing it using VBA Code?
    It's really pretty easy.
    I ran this little test up in under a minute:
    My form has a Text1 and a Text2 and a Command4.
    In the Code for the On Click Event for the Command Button

    Select the command button
    Property Sheet -> Event -> On Click -> click the [...] to the right -> Select 'Code Builder'.
    Put this between the two lines already in there [substitute your Text Box Names where I have Text2 & Text1:
    Code:
    Me.Text2 = Me.Text1
    In my case - when I type something into Text1, and click the command button - the text from Text1 is pasted into Text2.

    Hope this helps.
    I find using the Macro Actions a little limiting and using VBA Code a lot more versatile.

  3. #3
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71
    yeah I think I can do that. so, is me. the form name and text1 the control or field name?

  4. #4
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71
    I did get that to work and thank you for that. I would also like to be able to to a different form for the same record (attached to each other by linked master fields andn link child fields). How do I do that as well

  5. #5
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71
    I've attached a small DB as an example of what I would like to ulimately do. Testing1 is the main form. from there I would like to hit command1 button and take the data from the field "copyfromfield" to the table2field in the form or table table2. But I want the data to go to the correct record based on the linked master fields and child fields.

  6. #6
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71

    the atachment

    here is the database

    Database5.accdb

  7. #7
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    yeah I think I can do that. so, is me. the form name and text1 the control or field name?
    Yes. That's correct.

  8. #8
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I would also like to be able to to a different form for the same record (attached to each other by linked master fields andn link child fields). How do I do that as well
    Here's a site that gives you some quick exampleas of how to do this.
    http://www.baldyweb.com/wherecondition.htm

    Let me know if that doesn't help.

  9. #9
    mchadwick is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    71
    this is actually useful, I knew you could do that but I didnt know how. What I need is different though.

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

Similar Threads

  1. Importing from clipboard?
    By mrrrgh in forum Access
    Replies: 5
    Last Post: 04-27-2012, 11:36 AM
  2. Replies: 1
    Last Post: 12-20-2010, 02:22 PM
  3. Clipboard on Duplicate Record
    By Alaska1 in forum Access
    Replies: 5
    Last Post: 12-02-2010, 10:25 AM
  4. Use VBA to copy table contents to the clipboard?
    By Deutz in forum Programming
    Replies: 3
    Last Post: 10-21-2010, 10:59 PM
  5. Clearing the clipboard with VBA?
    By Simon Sweet in forum Programming
    Replies: 1
    Last Post: 04-17-2008, 03:16 PM

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