Results 1 to 6 of 6
  1. #1
    delta is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    19

    main form and sub form

    I would like to create msaccess work for my office filing system.

    There will be 2 tables.


    Table 1 :
    sn_ ................................this serial number is manual
    file name ........................text

    Table 2 :
    sn_.................................this serial number is auto
    file_name........................text
    documents_detail.............text
    note...............................memo

    My issue is I dont have clear cut idea about connecting table. Please educate me.

  2. #2
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    First of all the title is misleading as this is about tables not forms.

    Secondly there is no point having a table whose fields are identical to another table.
    In fact it is wrong to do so because you would be duplicating data.

    Scrap table 1

    If you need to use the same file in more than one way, then create a second linked table
    E.g. If each file contains a list of items that need to be stored separately, one item per record

    Suggest you remove underscores and use Camel Case instead e.g FileName
    Last edited by isladogs; 01-26-2018 at 05:22 AM.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    delta is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    19
    I understand you mentioned ridders 52.
    Please educate me how to connect both table.

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,928
    I agree with Colin, but if your example is incomplete and table1 contains more data (such as file location) and you can have many table2 records for each table1 record then scrap the file_name field in table2, make the sn field in table 1 an autonumber and primary key and sn in table2 a long (manual as you call it)

    Then to create a relationship in the relationships form, join table1 to table2 on the sn fields, right click on the line and select 'enforce referential integrity'

    Assuming this is the case, then table1 becomes your parent table and table2 the child table so in your form design, the main form would be based on table1 and the subform on table2.

  5. #5
    delta is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jul 2013
    Posts
    19
    actually I need auto key in table 2 and I need manual number in table one. Can I ?

  6. #6
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Quote Originally Posted by delta View Post
    actually I need auto key in table 2 and I need manual number in table one. Can I ?
    That's what you wrote in your first post.
    Let's be clear- it's your database and you can do anything you like including ignoring advice given.

    Before doing so, you should have a very good reason for needing to duplicate part of table 2 in table 1.
    Doing so, violates standard database methods

    And IF you go ahead, consider some of the issues with keeping the tables synchronised.
    1. Each time a record is added to table 2, it needs to be added to table 1
    2. Similarly when records are deleted
    3. If a file name is altered in one table it needs to be altered in the other.

    Whilst there are methods for automating some of that e.g referential integrity, is it worth it?
    You could of course remove the filename field from table 1 leaving you with just the ID field ....but what use is that?

    Hopefully I've made the point now

    Good luck with your project
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Replies: 10
    Last Post: 07-05-2017, 11:31 AM
  2. Replies: 8
    Last Post: 03-20-2017, 07:22 PM
  3. Replies: 8
    Last Post: 09-14-2015, 09:38 PM
  4. Replies: 17
    Last Post: 08-22-2013, 08:22 AM
  5. Replies: 2
    Last Post: 11-13-2012, 02:11 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