Results 1 to 2 of 2
  1. #1
    graffiti is offline Newest Newbie ever
    Windows XP Access 2003
    Join Date
    Nov 2011
    Location
    Worthing, south coast of the UK
    Posts
    21

    Code to copy data from one field to another?

    Hi.

    I know this will be one of the most basic questions you ever get asked in this forum, and for that I apologise, but when I read books and google I get so much info that is not related. I'm now confused!

    An example of my problem:

    Table1 has a field called "name"
    Table2 has a field called "Who"

    Table 1 will hold details of the person currently logged in. When an event is called I want VBA code to copy "name" from Table1 and put in in a new record in Table2, (along with dates and times).



    I assume I need to work with recordset?






    Aside.
    This was one of my google searches. "Access 2003 copy field to new record".

    I can now:
    • use buttons to copy from one place to another, create a new database in A2007,
    • Assign some default values,
    • get vauge instructions: "Then, in the OnCurrent event of the new
      Record, copy the content of the variables to the appropriate Controls on the new Record." HOW??
    • And so on, but nothing useful so far!
    Thanks for your help.

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    SQL is not my long suit, but maybe

    you could create a query to get the current user info and integrate that into an 'update' query. I always work with the query design and build queries if I have to, rather than try to write in SQL.
    Yes you can certainly do it with VBA if necessary. Did the example you mentioned show you how to create a recordset object?
    http://msdn.microsoft.com/en-us/libr...ice.12%29.aspx

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

Similar Threads

  1. Replies: 3
    Last Post: 07-20-2011, 01:04 AM
  2. Replies: 3
    Last Post: 05-23-2011, 07:29 AM
  3. Copy Database Code Error
    By Tomfernandez1 in forum Programming
    Replies: 5
    Last Post: 05-03-2011, 12:21 PM
  4. Code for data import with calculated field
    By Tyork in forum Programming
    Replies: 2
    Last Post: 01-21-2011, 03:15 PM
  5. String to Copy a Field of Data to Another Table
    By aquarius in forum Programming
    Replies: 1
    Last Post: 09-17-2010, 09:02 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