Solved

Best query solution for a form with a one to many results

Posted on 2012-12-28
6
257 Views
Last Modified: 2012-12-28
Hi everyone,

I have a table which houses a number of cross reference entries.  I am building a form to display this data.  My table includes item_nr, vedor, v_item_nr.  I have approximately 10 vendors to display.

For each item number, I need to display the cross reference information as

Header
Selection, Vendor1, Vendor2, Vendor3, Vendor4, ect...
Detail
Item_nr, V_item_nr, V_item_nr, V_item_nr, V_item_nr

In cases where one Vendor has multiple items, I assume I'd have more then one record in the form.

Would I need to build 10 different queries and combine them based on my Item_nr selection or is there a better way to handle this?

My current form uses a query that takes the data from ten different vendor tables, however I was told this was an inefficent way of handling the data.  I normalized it to one table, however now I am uncertain how to best capture the data.

I attached a screen shot of my current form.   Thanks for whatever help is offered.
0
Comment
Question by:MCaliebe
  • 3
  • 3
6 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38727663
@MCaliebe

screenshot is missing.

Normally, the best way to display this information would be vertically in a subform, rather than trying to do it in a query.  This way, you could have any number of vendors and V_item_nr values.
0
 

Author Comment

by:MCaliebe
ID: 38727911
Screen shot attached
ScreenHunter-01-Dec.-28-11.52.jpg
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 38727932
As I said, it generally makes more sense to display this as a subform (or as a continuous form popup) rather than trying to go horizontal like this.  For one thing, as you add new vendors, you will have to add columns to the form or reports, but if you go vertically, with columns for Vendor, v_item_nr, and price you can have as few (or many) vendors as you want, and will only display those vendors which sell that item.
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.

 

Author Comment

by:MCaliebe
ID: 38727964
Can you direct me to an example of this type of form.  I can't wrap my head around the design.
0
 

Author Closing Comment

by:MCaliebe
ID: 38727983
I got it.   I figured out how I can do this with a simple query and a form in Data Sheet or Continuous view.  I believe we make look for something to be so difficult that we overlook the obvious.
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 38727987
glad to help.
0

Featured Post

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 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

17 Experts available now in Live!

Get 1:1 Help Now