Solved

Pull fields from another file into tabular continuous subform

Posted on 2013-02-05
9
215 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
 

Author Closing Comment

by:Matt Johnson
ID: 38860155
Thanks.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now