Results 1 to 15 of 15
  1. #1
    Sc0tt1e is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2020
    Posts
    15

    fields available in other tables - specify relationship - unexpected results

    Attached are 2 screen shots to assist.

    I am trying to add the Ltd Co name on to a from and it will not work the way I want.

    I would like the value blank unless someones associated to a Limited Company in which case the field is populated.

    I think I have my relationships set up correctly.

    When I try to add the field via layout mode - add existing field the value I want is in 'Fields available in another table'. When I select it it asks to validate the relationship so I set IDCustomer and IDLtd as the joins but it reduces the number of customers and shows the Ltd Co names in order:

    There are 21 customers only 3 Ltd Co names and 5 people are associated to Ltd Co purchase (2 couples and a single individual). When I set the relationship there are only 3 customers and each has a different Ltd Co name and it is against the incorrect customer (customers 1-3 have Ltd Co names 1-3 against them.

    I hope that all makes sense.

    Please help I've no idea what's going on. I can get my head around SQL codes but building these forms is driving me insane.
    Attached Files Attached Files

  2. #2
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    i think you need to add the table containing the field to the recordsource of the form and join on the common field.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  3. #3
    Sc0tt1e is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2020
    Posts
    15
    The field I want to insert is from another table (Ltd Co) which doesn't show in the list of allowable fields when trying to set the record source.

  4. #4
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Add JcustLTD and tLTDco to the forms recordsource.

    If you can post your Db it would be helpful.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  5. #5
    Sc0tt1e is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2020
    Posts
    15
    Hahaha yes it would be very helpful but I cant get it under 600kb and 500 is the max size.

    I have posted screen shots of the relationship page and the form I'm trying to update for reference

  6. #6
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    delete anything not specific to the problem, do a compact and repair and then zip it in a zipfile?

    Have you tried what I suggested?
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  7. #7
    Sc0tt1e is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2020
    Posts
    15
    Lets see if the ZIP worked
    Attached Files Attached Files

  8. #8
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    You did not include all the needed tables.

    This is what you want?

    Click image for larger version. 

Name:	Screenshot 2020-11-14 115757.jpg 
Views:	20 
Size:	27.9 KB 
ID:	43447
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  9. #9
    Sc0tt1e is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2020
    Posts
    15
    That's what I want!

    When I try and add, I get DAV against Viki Bell and only 3 customers are visible (one for each Ltd Co name).

  10. #10
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Try this and see if its what you want

    Your joins were off I've changed it and uploaded below
    Attached Files Attached Files
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  11. #11
    Sc0tt1e is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2020
    Posts
    15
    Looks good, so what did you do?

    I need to understand so I can replicate it and ensure I don't make the same mistakes again later in the build?

  12. #12
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Open the recordsource query of your form.
    Right click on the lines joining the different tables and adjust the join properties.
    You need to adjust them until you get the results you want.

    Click image for larger version. 

Name:	Screenshot 2020-11-14 141911.jpg 
Views:	20 
Size:	76.8 KB 
ID:	43450
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  13. #13
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,651
    Heres one article about joins. A google search should turn up plenty of articles.
    https://www.informit.com/articles/article.aspx?p=330333&seqNum=6


    check the joins in your relationships also.
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  14. #14
    Sc0tt1e is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2020
    Posts
    15
    I'm confused as the image you have above is how I have it set up?
    I thought I was creating an outer join with TCustomer as the parent and TLtd Co as the child

  15. #15
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    I just took a look at your database and not understanding why you have your Forms setup in the way you have.

    The Customers Form linked to Properties are both not updateable. Why ?

    The usual setup is that you can add properties in the Subform.
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

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

Similar Threads

  1. Unexpected sort results
    By George in forum Modules
    Replies: 17
    Last Post: 07-21-2016, 08:00 PM
  2. Unexpected results on Inner Join
    By Access_Novice in forum Access
    Replies: 2
    Last Post: 09-05-2014, 12:50 AM
  3. Unexpected results with DAO recordset
    By GraeagleBill in forum Programming
    Replies: 1
    Last Post: 10-07-2012, 07:37 PM
  4. Unexpected Results from Curdir?
    By bginhb in forum Programming
    Replies: 6
    Last Post: 08-17-2011, 03:58 PM
  5. InStrRev returning unexpected results
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 12-07-2010, 01:04 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