Results 1 to 7 of 7
  1. #1
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101

    How To Add New Records

    Hello,

    I would like to know how to add new records into a table from another table.

    I have 2 tables A & B.

    A is the main file and if customers wanted to add new data into table A and if he clicks on add records in table A then table B needs to open. So that they want to add records in Table B. Later we will update table A from B.



    I used macros to do it but it's not fine.

    Could you kindly help me out on how to do this

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Not sure what you are doing. Why would you copy data from table B into table A? Exactly what is the data in each 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.

  3. #3
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    table A and B consists of same number of columns

    They contains data like Name, Date, Pages, University, Email etc.....

    Table A is the main table.....

    I don't want front end users to add data into the main table A. So, I created an another table B. If they click on add data button in table A then it should redirect to table B.

    We will update the main table A every week based on the new records of table B.

    Let me know if you are unclear with my post.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Users should not work directly with tables. Cannot put code behind tables or queries. Build forms as user interface. Besides, if they can get to the Navigation pane, they can do whatever they want and you cannot prevent it.
    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
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Thanks for your reply. I was unable to get you

    What I had done in my project.

    I created a main form named "MFORM". In MFORM I created a command button named "Add Records" through Macro.

    If you click on that Add Records button then the programeed macro will open a new form named "Add Table". So, The users can add records in "Add Table" form. I programmed adding of new records to Add Table form through macros again.

    Problem am facing :

    If I click on Add Records on MFORM then the Add table is going to open and it is fine.

    Add table by default showing the 1st record. if we add records in it then it is modifying the details related to 1st records. Inorder to prevent this I added an command button named "Clear Parameters". whenever the add table form is opened then first we need to click on clear parameters and then we need to add records.

    My Requirement :

    When the add table form is opened it should not show the records. we should directly add the new records instead of clearing the parameters first.

    For a better understanding I have attached my project. Kindly have a look into it.

    MFORM is the main form
    Main is the main table

    Add Table is the secondary table to store records by the customers.

    I will be happy if you need much more information from my end.
    Attached Files Attached Files

  6. #6
    Mahendra1000 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2013
    Posts
    101
    Got it. It worked.

    I forgot to set the argument to Add in DataMode action argument.

    All works well.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    If you don't want existing records to show on AddTable form, options:

    1. set its DataEntry property to Yes

    2. use code to open the form in DataEntry mode
    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. Replies: 2
    Last Post: 05-28-2013, 04:00 PM
  2. Replies: 1
    Last Post: 02-16-2013, 11:36 AM
  3. Replies: 1
    Last Post: 01-24-2013, 05:50 PM
  4. Access 2007 - Creating New Records Based on Existing Records
    By GeorgeAugustinePhillips in forum Forms
    Replies: 9
    Last Post: 10-05-2011, 05:58 PM
  5. Replies: 12
    Last Post: 08-30-2011, 03:36 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