Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pull fields from another file into tabular continuous subform

Posted on 2013-02-05
9
Medium Priority
?
223 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 85
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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Closing Comment

by:Matt Johnson
ID: 38860155
Thanks.
0
 
LVL 85
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 85
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

636 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