Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to check if a record is not exist in a table

Status
Not open for further replies.

davyre

Programmer
Oct 3, 2012
197
AU
Hi,

I have a form that has two listboxes named POListBox and CustOrderBox. In the POListBox there are Purchase Orders (OrderNumbers, desc, etc) and in the CustOrderBox there are units that are in a selected purchase orders. So in a big picture,
a user selects a PO from POListBox, then onClick event, there will be a list of units in the CustOrderBox that corresponds the PO.
Now what I want is (if it is possible) the system to check in a table called TblUnitAllocation, check whether there is a matching OrderID(from POListBox.value) and its UnitID(from CustOrderBox). If the record exists, then dont show the Unit in CustOrderBox, if it does not exist then show it. (This means that if in a PO, the units are already allocated in TblUnitAllocation, it wont show anymore on CustOrderBox)

So,
1. Select PO from POListBox ->get the OrderID
2. Search UnitID from TblCustOrderUnit where OrderID=OrderID from no 1
3. Check the existence from TblUnitStock (OrderID and UnitID), if exist then do not show on CustOrderBox, if not then show

anyone can help? Thanks
 
Nevermind, I found the solution using Find Unmatched Query Wizard. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top