Solved

Pull fields from another file into tabular continuous subform

Posted on 2013-02-05
9
218 Views
Last Modified: 2013-02-06
I am trying to load a subform with the various pickups for a shipment from my shipment detail file.  On each line I want to display the supplier name and contact info pulled from my supplier file.  When the subform lines load they all show identical data from either the last line loaded or the last line modified instead of each line showing the info for that specific pickup.  I have been using a dlookup in a subroutine tied to the on current event from my main form.

Thanks.
0
Comment
Question by:Matt Johnson
  • 4
  • 4
9 Comments
 
LVL 84
ID: 38858931
You should bind your subform to the "shipments" table, and then set the master/child links for the subform to represent the relationship between that table and the Parent table.

Continuous subforms show the same control multiple times, and then Access will show the data relevant to each record, but only if you bind the subform. If you try to fill the subform yourself, or try to show a different value for each record (like using your DLookup), Access won't let you do that and will instead show the same value in each control.
0
 

Author Comment

by:Matt Johnson
ID: 38860040
Let me clarify what I have.  The main form is showing my shipment header file.  The subform is displaying my shipment detail file (list of pickups for the shipment) which is linked to my main form and is working properly.  On each of those lines, I also want to include some information about the supplier that each pickup is coming from so I'm trying to do a dlookup against the supplier file on each one of those shipment detail lines to load text box fields.  The supplier info is not populating correctly as I described above.  Although the comment above was talking about linking main form to subforms, is the statement about dlookups not working applicable to my added text box fields on the subform?  I'm going to have to find another way to show fields from multiple files in a subform - correct?
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 38860078
Yes, my original statement is correct - you can't use a DLookup on your continuous subform to show different values on different lines. In order to do that you must use a Bound Control, and your form's recordsource must provide that bound control with the values. Most often you would build a query to show those values, but that assumes that the "other" data you need is present in a table in the database (linked or local).
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Closing Comment

by:Matt Johnson
ID: 38860155
Thanks.
0
 
LVL 84
ID: 38860653
Was there some reason you graded this a B?

The answer is correct (you can't do that is a valid solution -  see here: http://www.experts-exchange.com/help/viewHelpPage.jsp?helpPageID=23), and I gave you a method to work around the issue (build a query that includes all the fields needed for the subform).
0
 

Author Comment

by:Matt Johnson
ID: 38861220
It was a B because I was thinking a work around would have helped me out.  I guess you gave me one, but when I read the workaround it wasn't very clear to me at the time.  I since did more work on my project and see what you are talking about.  I am just getting starting developing my Access database, so I'm on a very steep part of the learning curve.  I also have used this site and grading very little so I need to understand that process better also.  You gave a good answer, but I wasn't experienced enough to understand it or give the grade I maybe should have.
0
 
LVL 84
ID: 38861435
In situations like that, just ask us for more help. If the workaround (or solution) isn't clear ask us to give you more details, or provide some examples. Our goal is to help you ...
0
 

Author Comment

by:Matt Johnson
ID: 38861761
Thanks.  I will do so in the future.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question