Results 1 to 14 of 14
  1. #1
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8

    Problems with macros

    I wish to set up a macro that copies data in a chosen field pastes it to another field and returns to a different chosen field.
    I am having to use ctrl+c then a defined ctrl+letter then ctrl+v and finally another defined ctrl+letter.
    This is a pain.
    Is there a way to operate ctrl+c and ctrl+v from within a macro?

  2. #2
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    Yes with code. Not with a macro. (Though a macro is code - it has a specific structured definition in the Access product.)

    So your first task is to determine when this is to occur. Let's assume it is to occur after the user updates Field1; so in the AfterUpdate event you would put:

    Me.Field2=Me.Field1 'this is the copy
    Me.Field3.SetFocus=True 'this is putting the cursor in the field

    obviously use the actual field name than my generic 1,2,3. that's it.

    hope it helps.

  3. #3
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8

    Problems with macros

    No that does not really help - I will carry on with my reliable but boring manual system!

    Thanks anyway.
    Last edited by Malcolm; 07-21-2011 at 02:48 AM. Reason: Added thank you

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    a macro is basically vb code my friend. You gave up on the idea awfully quickly when it probably could have done the job you want.

  5. #5
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8

    problems with macros

    hello rpeare

    Perhaps I did not explain the problem fully.

    The material I am dealing with has been imported from an excel file where information relating to a specific item was carried over two or three rows for some of the items. This was probably done to keep the relevant area of the excel file on the screen.

    So what I need to do is copy info from the first relevant field on the second duplicate item record into the next empty field on the record above and then return to the next relevant field in the second record and so on.

    Making ctrl+c and ctrl+v work as macros whic could then be included in a combined macro would make this an easy problem to solve.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    If the problem is purely in excel then this is probably not the right forum, this is an Access (database) forum not an Excel (spreadsheet) forum. That being said vb script is vb script and if you can give an example of what you're talking about someone can probably figure it out.

  7. #7
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8
    Rpeare

    There is not a problem with excell.

    All I require is a straight answer.

    Is it possible to get the built in keystrokes ctrl+c & ctr+v to respond to a macro?

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Your 'question' doesn't have a straight answer, I don't really know what your process is because your posts aren't clear. You don't say if you're doing your data entry directly on a table or in a form. You don't show any code, you don't show any SQL statements, nothing so it's really hard to give you a definitive answer without information other than you want to copy and paste. It's not even clear what is the primary problem, from reading it I thought you were maybe exporting data from access to excel but all the data was not transferring, and it could possibly mean something else as well. Then you said you want to copy and paste within excel but then you're saying it's not an excel problem so I'm understandably confused.

    If you are doing data entry on a FORM in ACCESS then there is CODE you can run to perform pretty much any action you want. If you're doing data entry in EXCEL you can probably still run code or have some underlying formula but that's a different question altogether.

  9. #9
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8

    problems with macros

    Rpeare

    I will reitereate my last question.

    Is it possible IN ACCESS to perform the actions normally undertaken by the keystrokes ctrl+c and ctrl+v within a macro?

    I hope this is plain enough.

  10. #10
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I think I just officially gave up, no offense to you but I'm clearly not making it through to you, maybe someone else will have better luck.

  11. #11
    jscriptor09 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    60
    I think the confusion is coming from mixing EXCEL macro with ACCESS macro.
    In Excel, you can turn on macro recoring, do the cntrl C and cntrl v thing and their you have it, a recorded macro to reply over and over.

    Access does not work this way. I does have macro but mostly related to operation on Forms, table, queries and so forth.

    There for, the answer to your question is NO you can't do it the Excel way.
    However, there is plenty of VBA codes to step throug records and do what you are trying to do.

  12. #12
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8

    problems with macros

    One last time then I give up.

    IN ACCESS is it possible to produce a macro which will do the same operation as CTRL+C?

    YES or NO please!

  13. #13
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8

    Smile Problems with macros

    I've solved it myself!

    All it needs is a run command within a macro (Copy) or (Paste) and it works fine.

    I can now do what I wanted to do in one keystroke action.

    Thanks all the same.

    Threadcan now be closed.

  14. #14
    Malcolm is offline Novice
    Windows XP Access 2000
    Join Date
    Jul 2011
    Posts
    8
    In the latest version of access microsoft in their wisdom have removed the facility to merely press the down key and generate the next number in a sequence in the same field ad infinitum.
    They say this is because it has been reported as a nuisance to some pros. What about all us amateurs that found this really useful when adding records to databases to help with the archiving of photographs, railway engines, books etc etc?
    Is it possible to set up this useful function again?

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

Similar Threads

  1. Macros
    By kstyles in forum Programming
    Replies: 2
    Last Post: 07-12-2011, 01:38 PM
  2. vba vs macros
    By RedGoneWILD in forum Access
    Replies: 4
    Last Post: 08-06-2010, 12:48 AM
  3. VBA vs Macros
    By Evgeny in forum Programming
    Replies: 3
    Last Post: 05-11-2010, 02:15 PM
  4. VBA or Macros
    By mastromb in forum Forms
    Replies: 6
    Last Post: 01-03-2010, 04:46 PM
  5. Macros
    By kfhai in forum Access
    Replies: 0
    Last Post: 04-17-2009, 08:28 AM

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