DELETE Query -- Question -- two criterias need to match

K

kealaz

I have a table [tblWHEREUSE] to handle my bill of materials. The table
structure is as follows.

tblWHEREUSE
PART_NO
USED_ON
QTY_USED


which describes something that could be potentially described below...


qty. 5 of part001 used on assy001
qty. 6 of part002 used on assy001
qty. 7 of part003 used on assy001

qty. 2 of part001 used on assy002
qty. 3 of part002 used on assy002
qty. 4 of part003 used on assy002

qty. 7 of part001 used on assy003
qty. 8 of part002 used on assy003
qty. 9 of part003 used on assy003



If I am no longer using part001 on assy002 (but it is still being used
elsewhere), what is the best way to remove this record?

I need this record to be deleted to match exactly on both PART_NO and USED_ON.



I have messed this up so bad, it almost isn't even worth mentioning what
I've tried. I have tried using a delete query with [Enter Part NO:] and
[Enter Used On:] and then trying to link this to a form. Really didn't work
and I'm not sure where I'm messing up.

So, I'm trying to take a step back and say, if I were starting from scratch
and here's what I need to accomplish.....

Any help on how to proceed from here would be greatly appreciated.


Thanks!
 
K

kealaz

Hi Ken,

Thank you for taking the time to reply to my question. I have downloaded
your demo. I think it's slick and would love to have something similar for
our BOM. I don't think that I have the skills, at this time to implement
what you have to work with the tables that I have. Being a complete novice,
it's all quite overwhelming.

Thanks again for responding to my post.

Do you have any suggestions for how I might delete the record from my table,
based on the two criterias outlined above?

Thanks so much!
 
J

John W. Vinson

I have a table [tblWHEREUSE] to handle my bill of materials. The table
structure is as follows.

tblWHEREUSE
PART_NO
USED_ON
QTY_USED
If I am no longer using part001 on assy002 (but it is still being used
elsewhere), what is the best way to remove this record?

I need this record to be deleted to match exactly on both PART_NO and USED_ON.

Hrm. Don't know why this is causing problems:

DELETE * FROM tblWhereUse
WHERE PART_NO = [Forms]![SomeForm]![txtPartToDelete]
AND USED_ON = [Forms]![SomeForm]![txtUsedOn]

should work.
 

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