Depentant Fields

rival

Registered User.
Local time
Today, 15:08
Joined
Nov 18, 2005
Messages
17
hey, again..

I need a little assistance :D

I have a table 'tblWorksOrders' - it is a data entry table which holds the records of our company's production.

Each PurchaceOrder recieved (Stock for use on works orders) is designated to a customer and the relevant information is entered.

When it comes to production, the user is prompted to choose the customer from a drop down. Once the customer is selected i then ask for a confirmation of the Customer's reference number or POID.

For ease of use, i dont want the POID drop down list to contain all PO's for all Customers but just the customer which has been previously selected in the field above.

MY current query is;

Code:
SELECT qryPObyID.SupplierID, qryPObyID.POID, qryPObyID.StockCode, qryPObyID.SupplierRef, tblWO.Customer FROM tblWO INNER JOIN (qryPObyID INNER JOIN tblPO ON qryPObyID.POID=tblPO.POID) ON tblWO.Customer=tblPO.SupplierID WHERE (((qryPObyID.SupplierID)=tblWO.Customer));

but just groups by sustomer. What i have tried to do is make the selection only show the files where the CustomerID of the PO matches the CustomerID chosen above in the forn.

If you can see my error or have any suggestions please give them?

EDIT the above code was my attempt to run through a query, rather than a table. neither i have managed to achive the desired result. I have tried basic

Code:
[tblWO].[CustomerID] = [tblPO].[CustomerID]
 
Last edited:
i know its an old bump, but i have been working around this upto now, and have sucessfully got quite far with the project. I am still having problems with the above thou. My current code is;

Code:
SELECT tblPO.POID, tblPO.SupplierRef, tblPO.QtyRaw, tblPO.QtyRaw FROM tblPO WHERE (tblPO.SupplierID = Forms!tblWOPacking!Customer) ORDER BY tblPO.QtyRaw;

I am certain this should be restricing my PO selection to the POs who's customer field is equal to the Customer value secected on the Works Order Packing screen.

Am i doing something obvious wrong?
 
Last edited:
Pat Hartman said:
You are comparing supplierID to customer. Shouldn't the table field name be customerID or customer?


this is bad naming on my behalf. I am using the term customer to identify the customer for the packing, at the same time this customer is the supplier of the fruit.

My customer field is a look up of supplierID. Caould the names be giving me this problem? both fields do in fact point to SupplierID
 
My failure to grasp this is probably due to lack of experiance. I understand that i should state in the Expresion builder i need to preform a requery on the second dependant combo box with the above statement.

i have used the above statement as

me.'nameofsecondcombo'.Requery

but get an error with the expression me at every stage of entry through the expression builder or typed in directly. I have tried to get around this by entering the date (below) into the gotfocus field of the second combo (who's data i want restricting)

again here is my statement. in fact when entering into the expression builder for gotfocus i am getting many expression errors. Any reading material would also be appreciated :P

Code:
SELECT tblCharges.ChargeID, tblCharges.Cost, tblCharges.Per, tblCharges.Description FROM tblCharges WHERE tblCharges.SupplierID=FORMS!tblWOPacking!Customer;

thanks

EDIT sorry the ME.ChargeID.Requery enters fine, obviously in code builder but the update to the ChargeID with the selected SupplierID (Customer field on my form)
 
Last edited:
i have attached my DB. The form in query is tblWOPacking, feilds Charge Per Unit (ChargeID) and Customer(SupplierID)

http://www.megaupload.com/?d=MWPY9KGL sorry for Megaupload

Sorry if its too ugly! One main issue of the DB is that it only alows one probuct per POID which was a problem in my initial development i couldnt resolve, possible one of rthe future!

thanks for anytime spent looking over this.
 
i know its a triple post but i have got it resolved. I obviously had problems with my 'BoundColumn' selection or similar. Where before i was displaying the SupplierID in the combo box but the actual value being held must have been the Customer Name and therefore never matching tblCharges.SupplierID

Thanks for persistance anyhow :P
 

Users who are viewing this thread

Back
Top Bottom