Solved

Pull fields from another file into tabular continuous subform

Posted on 2013-02-05
9
220 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
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.  

 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

733 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