Results 1 to 10 of 10
  1. #1
    Traceyannabanna is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    11

    Subform autofill

    Hi My database is for my insurance company offering various different types of insurance. I have a form(single) called Frmclients with a subform (continuous) called Sfincomeinsurance
    Frmclients has Client ID and Surname with a combo box to select the client. This autofills the form and subform with the client ID and surname. The client is the main person that holds the insurance policy but has other family members such as spouse. One of the fields in my subform is "person insured" . I wondered if there is a way to select that person from a list associated with the client id? EG I would choose "Bloggs" from the combobox on the main form and then get a choice of Mr Bloggs family members to choose from in "person insured" Hope that makes sense. Thanks in advance

  2. #2
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Yes, reference the ID on the main form in the query for your subform.

    so the subforms record source has all the info you want to display. Then in the criteria for the ID field (whatever that may be called) you should have :

    Code:
    =forms![Frmclients]![whatever the text box is called with the ID]
    obviously you just name the textbox there. haha. any questions just ask.

  3. #3
    Traceyannabanna is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    11
    Hi Thanks for the info. The forms dont have a query. I did them with the form wizard and works really well apart from the fact that I would like to be able to choose the person insured/family member from a list associated with that client

  4. #4
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    It will have a query which runs that form. Even if that query isn't listed on the left under querys.

    In properties> data tab > record source. This is your query for the form. you can open it by clicking the three little dots (...)

  5. #5
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    All your doing is limiting the information you want to show. You can limit that information however you like, but as these are going to all be related to one person.. The ID of that person should be the "filter" if you like in the criteria for "person_ID".

    Hope I'm making sense here because you can do this pretty easily (if I'm answering it cant be too hard).

  6. #6
    Traceyannabanna is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    11
    Great fingers crossed that I can do this then So....where do I insert the code that you put in your first message? Sorry I am very new to access.

  7. #7
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    [whatever the text box is called with the ID] in that piece of code you do need to change. I know I keep saying it but I want it to be clear.

    this is on the criteria row for the ID of the person.

  8. #8
    Traceyannabanna is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    11

    Uploaded Zip for HomegrownAndy

    Zip file attached
    Attached Files Attached Files

  9. #9
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    I was just looking. This is as messy as my first database! haha. You seem to have a lot of data repeated. You need to follow rules of normalisation.

    EG. you have family name everywhere. This is counter productive. If all tables are linked to the client via the client ID then you only need information specific to the client in that table.

    so. in your pensions table for example. that pension relates to client "x". client "x" details are in the client table and the relationship between those tables will allow you to manipulate the data how you want it.

    This is the first thing I have seen on there but it does nee looking into. If you have any questions this is the place for them.

  10. #10
    Traceyannabanna is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Apr 2017
    Posts
    11
    OK thanks I will have another look at it

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

Similar Threads

  1. Replies: 7
    Last Post: 08-29-2016, 09:34 AM
  2. Replies: 2
    Last Post: 06-22-2016, 07:32 AM
  3. VBA Code to Autofill Subform
    By dgutsche in forum Programming
    Replies: 18
    Last Post: 09-08-2014, 02:07 PM
  4. VBA Autofill Subform Fields Locked on AddNew
    By DragonTech in forum Programming
    Replies: 9
    Last Post: 06-12-2014, 01:11 PM
  5. Subform - autofill data from main form
    By Kelly_D in forum Access
    Replies: 3
    Last Post: 03-20-2012, 11:36 AM

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