Results 1 to 11 of 11
  1. #1
    b3nb123 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    9

    Select which table for a form to edit

    At the moment I've got three tables for each of three year's worth of clients, the form for each is the same, so I've duplicated the form three times and edited the Record Source of each. So that works, with three forms listed for me to double click on to edit.
    But would it be tidier to have one form, then a radio button to select which table to load into the form? Can anyone talk me through how I'd do this?

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    You should have 1 form, and 1 table.
    all years in 1 table ,a year field lets you differentiate.

    then filter on 1 client, or 1 year.

  3. #3
    b3nb123 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    9
    I like the years to have their own table, that way I don't have clients info from 5 years ago, once the years have passed I file the old year away and don't swim in all the old data!

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    You could do it on one form. The radio button after_update event would change the recordsource for the form to the appropriate table/query.

  5. #5
    b3nb123 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    9
    That sounds like what I need. Unfortunately, I've never worked with queries / radio buttons etc, I'm guessing it's a little too complicated to just walk me through it?!

  6. #6
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    I'm guessing it's a little too complicated to just walk me through it?!
    Can you post your db here? I'll take a look and see what is required.
    Last edited by davegri; 01-29-2019 at 11:01 AM. Reason: quote

  7. #7
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Hi b3nb123!

    Take a look in the attached sample database to take some ideas in one-table way.

    Regards,
    John
    Attached Files Attached Files

  8. #8
    b3nb123 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    9
    Thanks, I'll look into that when I have a chance!

  9. #9
    dashiellx's Avatar
    dashiellx is offline Falconer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Location
    Baltimore
    Posts
    56
    Quote Originally Posted by b3nb123 View Post
    I like the years to have their own table, that way I don't have clients info from 5 years ago, once the years have passed I file the old year away and don't swim in all the old data!
    I understand that intuitively this seems like a good idea. However, your current database design will just make your Access application buggy, slow and inefficient. If you can change the structure, I'd highly recommend doing so now, rather than later when you realize you have to rebuild several days/weeks/months of work properly.
    Last edited by dashiellx; 02-01-2019 at 08:39 AM. Reason: grammar

  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Quote Originally Posted by b3nb123 View Post
    Thanks, I'll look into that when I have a chance!
    I recommend you do that ASAP and get your design more along relational principles. No need for a table per year and duplication/replication. accesstos has given a sample design/solution with 1 table in answer to your post.

    Good luck with your project.

  11. #11
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You're attempting to commit what is commonly known as 'Spreadsheet by Access' or 'Excel by Access!' If you insist on this approach, you'd be better off using a Spreadsheet program...because you're going to lose most of the speed/advantages of using a relational database!

    Simply put...

    • All Records for all Years go into a single Table
    • That Table has a Field that identifies the Year for any particular Record
    • To see Records for a particular Year...you simply filter the Form by the desired Year

    Doing this is relatively easy...we'll be happy to help with that!

    And, as Orange suggested...you need to do this ASAP! Postponing this will only increase the time you spend, later fixing it, exponentially!

    Welcome to Access Forums!

    Linq ;0)>

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

Similar Threads

  1. form to edit records in A table.
    By it@rbi-tech.co.za in forum Access
    Replies: 7
    Last Post: 03-02-2017, 10:05 AM
  2. Replies: 32
    Last Post: 05-23-2013, 04:16 PM
  3. Replies: 1
    Last Post: 12-04-2011, 09:11 PM
  4. Replies: 1
    Last Post: 08-13-2010, 10:10 PM
  5. Combo-box to select item to edit in Form
    By DHavokD in forum Forms
    Replies: 7
    Last Post: 06-05-2009, 01:39 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