Results 1 to 3 of 3
  1. #1
    saboo is offline Novice
    Windows 8 Access 2007
    Join Date
    Apr 2021
    Posts
    1

    Angry autopopulate

    I have been working with Access 2007 for some time and usually have no problem that I can't get resolved via forums on the net. I have starting wanting more and more AI features with my software development which is my reason for posting.


    I have a main table that holds the unique information fields. I have created a query and based my forms on the query. To keep it simple, I have a field that is called File Number - which is a numeric field to prohibit duplicates. I have another table that holds actions taken on the files in the main file and a subform has been created to show the actions taken when a specific file is searched for. This all works great. When I have searched for a file number and its displayed in a form with a subform showing the actions that have been taken - I want to be able to add another action while on this form. I have created a form that works well for this purpose - however - I must manually enter the file number into the file number field on this "new action" form. What I would like is to have the file number filed auto-populate with the file number on the main screen with the subform so that there is no possibility of error. I have tried multiple ideas from examples on the internet but nothing worked. I actually got the field to populate once but it would not save the file number in the new record so the addition did not show up in the subform of actions taken.

    This is what I would like help with : how to get a new record in a separate table to autopopulate the file number field with the file number value on a form that is based on a query. This new table will be used as the source of the subform to show all the actions taken on that file.

    I have included the access db file for you.

    Thanks

    Scott

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    There's no file attached to your post.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Join Date
    Apr 2017
    Posts
    1,673
    Into your Main form (Files form), you have to create a continuous subform based on a table e.g. FileActions: FileActionID, FileNumber, ActionID/Action. (When you have a predefined list of actions, you'll have a table for them, and you use ActionID from there as FK. When actions are entered as free text, you have a text field for them in table FileActions). You link the subform with Main form through FileNumber - in subform's (NB! Not form's used as source of subform. Access creates subform container with same name as form it contains it by default, and it is a good practice to rename it immediately - like you have a form fActions added to Main form and you rename the created subform as sfActions). To link subform to main form, you have to open subform's properties, and (unless Access did this automatically) enter link field name as LinkChildField and LinkMasterField property values. Or in case the Main form source doesn't contain link field and you use an unbound control in Main form to enter/select it, you enter the control name as LinkMasterField value.

    When this is done properly, whichever file you select in main form, all actions entered for this file are displayed in subform. And whenever you add a new action into subform, it will automatically linked with currently active file in Main form (FileNumber's value in active row in main form is automatically entered into appropriate control in subform). NB! My advice is, you hide FileNumber control in subform to avoid any chance users mess up with it!

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

Similar Threads

  1. Autopopulate Fields
    By red246 in forum Programming
    Replies: 1
    Last Post: 05-01-2019, 03:47 PM
  2. Autopopulate
    By Jim Pepper in forum Database Design
    Replies: 2
    Last Post: 10-18-2016, 01:09 PM
  3. Autopopulate field
    By lynnmc26 in forum Access
    Replies: 10
    Last Post: 01-28-2012, 11:45 AM
  4. Autopopulate field
    By nancym in forum Forms
    Replies: 10
    Last Post: 11-07-2011, 09:53 AM
  5. autopopulate not working
    By slimjen in forum Forms
    Replies: 7
    Last Post: 09-16-2011, 01:38 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