Solved

Pull fields from another file into tabular continuous subform

Posted on 2013-02-05
9
216 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

863 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

24 Experts available now in Live!

Get 1:1 Help Now