Results 1 to 6 of 6
  1. #1
    Gamberick is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    3

    Copy data from one form to another.

    I am trying to create a "Copy & Paste" function for my database. Basically I have a search form with a list box (populated by a query), you can double click an entry to open another form that allows you to edit the entry.

    What I need to do is create a button on the second form that "stores" 9 values (Combo Boxes, Text and Dates). I then need to go back to the first form, find a different entry and paste those 9 values into it.

    All of the information is stored on 1 table, those 9 values are each a column on that table.

    If anyone would be able to help that would be great, let me know if any other information is needed.



    Thanks

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why are you copying data? This violates basic principle of relational database to not duplicate data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Gamberick is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    3
    Let me expand on what I am trying to do.

    The main table that I have is basically an inventory sheet, each item is unique and is an individual line. The first form allows me to see all the items in a list box that I can sort and narrow down with a search box. Each item has about 15 columns that are associated with it. Unique values are stored on the main table and common values are stored on separate tables and linked in. Double clicking an item from the list box opens up another form that lets me edit any of the non-unique values relating to that item.

    In a situation where I have to change 20 items in the same way from inventory to sold, add sale date, add customer name, etc. (9 total values) it becomes very time consuming to reenter the information from scratch for each entry, what I want to do is implement a feature that will let me fill one out "copy" those 9 values, open up the next item and "paste" those values in.

    This could easily be the wrong way to try to get this done and I am open to any suggestions on how I should implement this.

    Thanks

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Not getting the data structure. Do you want to provide the project for analysis? Can attach to post. Attachment Manager is below the Advanced post editor.

    I dealt with one other thread where poster was trying to do a 'copy/paste' operation between forms with VBA by clicking in source then destination textboxes, without having to select text,Ctrl+C,Ctrl+V, just click and click. Finally came to the conclusion not possible or so difficult not worth it. Is that what you were thinking of?

    VBA code can refer to a form control and copy its value to another form control, even on different forms. Have to be careful to be sure the records of focus are the desired records. Or VBA code can pull data from table and append or update record in another table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Gamberick is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    3
    Ok, I have attached the project, keep in mind that when I started this I have zero experience using Access so it might be a little rough around the edges.

    Let me know if there is anything else you need to know about what I am trying to do.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I think I see what you want, unfortunately my attempt to help someone do programmatic 'copy/paste to/from clipboard' of a set of data from one form to another failed. Options are:
    1. run APPEND or UPDATE query
    2. set global variables to values then set fields to variables.
    3. directly refer to form fields/controls: Forms!formname1!controlname = Forms!formname2!controlname

    If the clipboard method is possible, this might have clues http://stackoverflow.com/questions/5...ing-access-vba
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. copy data from one table to another
    By Sureshbabu in forum Access
    Replies: 1
    Last Post: 01-08-2012, 01:27 PM
  2. Replies: 1
    Last Post: 07-23-2011, 11:51 PM
  3. Replies: 3
    Last Post: 07-23-2011, 12:45 AM
  4. copy data from a subform to the main form
    By declanfogarty in forum Programming
    Replies: 1
    Last Post: 06-23-2011, 05:31 AM
  5. Copy data from one form to another
    By rcrobman in forum Programming
    Replies: 12
    Last Post: 05-24-2011, 01:25 PM

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