Results 1 to 13 of 13
  1. #1
    400Lifer's Avatar
    400Lifer is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2012
    Location
    Georgetown, ON
    Posts
    9

    Issue with displaying all records in linked tables using combo box and subform

    Hi!



    I have a main database with a linked (one to many) table [ PROJECTS and Service_Issues ] respectively.

    I have a combo box on my main form to select the record. The form populates (including pulling data from other tables.) I have a subform which displays current records (Service_Issues) connected to my main table (PROJECTS) with linked parent and child fields.

    My issue comes up when there are no records in the associated Service_Issues table - the form will not display the selected PROJECTS record and reverts to the previous record data from both the PROJECTS and Service_Issues tables.

    I'd like to be able to show a blank subform of the Service_Issues if there are no records, but also show the main PROJECTS record.

    Can someone help me out on this - I'm stymied! I've attached a zipped sample of my database.

    Thanks!
    Attached Files Attached Files

  2. #2
    winterh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    110
    I have a table and form set up a bit like your, I used the instructions below the only thing I did dif to them was add within my child table a column call "clientID" and when I defind the field for the relationship I used the PK in my main table and link it to "clientID".

    And it will show blank within the sub form within your main table and show data when in your sub form.

    If you need any more help let me know


    http://office.microsoft.com/en-us/ac...010098674.aspx

  3. #3
    400Lifer's Avatar
    400Lifer is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2012
    Location
    Georgetown, ON
    Posts
    9
    Winterh,

    the information on your link is how I setup the subform originally - however, I think there is an issue with how I've set up the relationship between my two main tables. If I have records in my linked table (linked to the PK of Table 1) the subform operates as expected. If there are no records in that table, then the main form doesn't reflect the record change, and the subform stays the same.

    Table 1 will always have records, and table 2 may or may not have records. Related as one-to-many.

    What is causing my form to populate incorrectly? Perhaps I've changed a property inadvertently that is causing this???

  4. #4
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    How are your Join Proprties set up? Try to join them where you include all records fom Table 1 and only those from Table 2 where the joined fields are equal.

    Hope that helps.

  5. #5
    winterh is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    110
    Hum...I will have a look at the prob in my form as mine works like the way you want yours to.

    Are both fields the same formate rg numbers?

    Have you defined your own 121 or did access do it for you?

  6. #6
    400Lifer's Avatar
    400Lifer is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2012
    Location
    Georgetown, ON
    Posts
    9
    This is my SELECT statement for this form - It's a biggie, and I'm not sure of the format for including an IsNull Command, or should it be an iif() ???

    SELECT Project.*, ProvState.ProvStateID, ProvState.ProvStateAbb, ProvState.Country, Customers.CustID AS CustID_Customers, Customers.Company, Customers.Contact, Customers.Address, Customers.City, Customers.Prov, Customers.PC, Customers.Country AS Country_Customers, Customers.Phone, Customers.Mobile, Customers.Fax, Customers.Email, Contractors.ContID AS ContID_Contractors, Contractors.Company AS Company_Contractors, Contractors.Contact AS Contact_Contractors, Contractors.Address AS Address_Contractors, Contractors.City AS City_Contractors, Contractors.Prov AS Prov_Contractors, Contractors.PC AS PC_Contractors, Contractors.Country AS Country_Contractors, Contractors.Phone AS Phone_Contractors, Contractors.Mobile AS Mobile_Contractors, Contractors.Fax AS Fax_Contractors, Contractors.Email AS Email_Contractors, Contractors.Notes AS Notes_Contractors, Architects.ArchID AS ArchID_Architects, Architects.Company AS Company_Architects, Architects.Contact AS Contact_Architects, Architects.Address AS Address_Architects, Architects.City AS City_Architects, Architects.Prov AS Prov_Architects, Architects.PC AS PC_Architects, Architects.Country AS Country_Architects, Architects.Phone AS Phone_Architects, Architects.Mobile AS Mobile_Architects, Architects.Fax AS Fax_Architects, Architects.Email AS Email_Architects, Installers.InstallerID, Installers.[Last Name], Installers.[First Name], ServiceIssues.ServiceID FROM (Installers INNER JOIN (Architects INNER JOIN (Contractors INNER JOIN (Customers INNER JOIN (ProvState INNER JOIN Project ON ProvState.ProvStateID = Project.JobProv) ON Customers.CustID = Project.CustID) ON Contractors.ContID = Project.ContID) ON Architects.ArchID = Project.ArchID) ON Installers.InstallerID = Project.InstallerAssigned) INNER JOIN ServiceIssues ON Project.ProjectID = ServiceIssues.ProjectID;


    I've played with different syntax but I'm not getting anywhere...this is what happens when you know a little bit and jump in too deep...hahah

  7. #7
    400Lifer's Avatar
    400Lifer is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2012
    Location
    Georgetown, ON
    Posts
    9
    Quote Originally Posted by winterh View Post
    Are both fields the same formate rg numbers?

    Have you defined your own 121 or did access do it for you?

    rg numbers? 121? lost me.... LOL

  8. #8
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Is it possible for you to post the project for further analysis?

  9. #9
    400Lifer's Avatar
    400Lifer is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2012
    Location
    Georgetown, ON
    Posts
    9
    I've changed the last INNER JOIN to LEFT OUTER JOIN, and this gives me the correct result! (Yay) Thanks for the input !! What a relief!

    Now where I still have an issue is on my selection of the combo on the main form - I cannot cycle past the first four records. I know it's something simple, but I just can't figure it out...looking too closely I think....

  10. #10
    400Lifer's Avatar
    400Lifer is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2012
    Location
    Georgetown, ON
    Posts
    9
    Sure! I posted it on my original thread...but here it is again....any help I can get would be wonderful!!!
    Attached Files Attached Files

  11. #11
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Thanks. I figured you might have made some changes since the OP.

  12. #12
    TG_W is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2010
    Location
    Manvel, TX
    Posts
    299
    Dagnabbit -it won't open. Can you save it to .mdb and post that way? Stupid 2007 not being compatible with 2010

  13. #13
    400Lifer's Avatar
    400Lifer is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2012
    Location
    Georgetown, ON
    Posts
    9
    Access2010 won't let me save in an earlier format. And the .mdb is too large to upload here...

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

Similar Threads

  1. combo box linked to subform
    By gbmarlysis in forum Forms
    Replies: 1
    Last Post: 02-01-2012, 02:28 PM
  2. Replies: 5
    Last Post: 12-19-2011, 02:53 PM
  3. Help! FE and BE linked tables issue
    By GraemeG in forum Access
    Replies: 1
    Last Post: 04-03-2011, 04:31 PM
  4. Replies: 2
    Last Post: 11-05-2010, 04:47 AM
  5. subform fails with linked tables
    By byterbit in forum Forms
    Replies: 4
    Last Post: 11-02-2010, 07:47 PM

Tags for this Thread

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