Query Only Vendor Match; How?

P

Parts Manager

Hello,

I have a form where I have created a query to get the items available to
place on order; but I am trying to figure out where and how to only extract
when the vendor matches.

tblOrder: ordId, ordVendor, etc...
tblOrderLine: ordlineId, ordlineId, ordlineVitem, etc....
tblVitem: vitemId, vitemVendor, etc...

tblOrder.ordId is a 1 to Many to tblOrderLine.ordId
tblVitem.vitemId is a 1 to Many to tblOrderLine.vitemId

I have created a query to get the tblVitem fields, but I don't think I have
it finished yet. I still need this query to get only records in tblVitem
that match the vendor.

In essence, I would like to choose in a combobox any item to order that
matches the vendor; "tblVitem.vitemVendor = tblOrder.ordVendor". But I have
no direct link between those two. The link, I thought would happen from
having a link from the Vitems to the order lines as that is where I am
ordering from. Sp I need a way to get a vendor match on the Orderline and
Vitem; yet the only place on the form where the Vendor is shown (kept in a
table) is on the form.orders where the field tblOrder.ordVendor is where it
is kept.

What should I be looking at to decrease the availalbe parts to order in the
vitem table by limiting it to only parts that a certain vendor carries?

When I go from design view to the SQL view I think it was, this is what is
displayed;

SELECT tblVitem.vitemId, tblVitem.vitemExternal, tblVitem.vitemDescription,
tblVitem.vitemUom, tblVitem.vitemPrice, tblVitem.vitemVendor,
tblVitem.vitemInternal
FROM tblVitem
ORDER BY tblVitem.vitemId;

By looking at that statement above (this query is in the subform); if I
could tell that statement to limit the results to the Vendor from the main
form, I would have it.

BTW, the link from Form Orders and the SubForm of Orders doesn't really
happen on my form I think until I do the Before Update Event. So until the
record is written, I don't think there is a relationship between the two.

This is my first time at trying to write a query, so I may be barking up the
wrong tree and should be doing something else. I have a form and subform
for placing orders. Well, it is a form/subform that I am working on and
have not finished it yet. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top