query confusion

Deonh911

Registered User.
Local time
Today, 13:25
Joined
Mar 5, 2013
Messages
30
Hello All

i have a table set up in a many to many relation with each other.
it is
tblProducts
productId PK
productcode
Description
Status

tblLink
ProductId PFk
Location PFk

tblLocation
LocationID PK
Location
QuantityIn
DateIn
PONumber

I have created a query that shows me the product by location
and a query to show me locations with product

What i am trying to do is have a main for that show me the product and insert a list box(Form Control) that show me the locations and the quantity for that product

the problem i am having is that i cant get the query to only show me the results for the product on the main form it shows me all the products on all the locations on the list box.

Thanks in advance and sorry if this is a dumb question i am rather new to access and most of the books works with addresses and invoicing so can bring what they say into context to what i am truing to do
 
you might be better using a subform to list out the quantities and locations - that way you can use the parent / child link so that it only displays info for the 'current' Product?

Failing that - you need to include criteria on the record source of the list box, limiting it to only the product you are currently viewing - you would need to refresh the list box whenever you look at a different product...

Hope that gives you a few pointers - I'm feeling a bit vague today but feel free to ask if you need more info. It would also help if me knew what version of Access you are using, and if you could post up a sample of your design so far..
 
Hello CasB

Thank you for replying i am attaching my DB as requested. i am using access 2007 and 2010 depending on the location i find my self.

Secondly want to say sorry in advance for my stream of stupid questions on the forums but i have been handed this problem to solve with no knowledge of the program i am using i have done up to where i am with the help of books and this forum.

I have a main form with 2 forms on the one form i use to put my stock in a location and a second form that is run from a sum query to show the total amount of products i have.

What i am trying to do is if i select a location it will show me all the products that is in the location i selected currently it shows me all the products on all the locations.
 

Attachments

OMG thanks for your help CazB i have actually got it right i was trying to use a list box based on a query instead of a sub form linked to a query that was my problem.

Thanks to your advice i saw my mistake much appreciated.
 

Users who are viewing this thread

Back
Top Bottom