Hello all,
I am trying to make a VBA script that will be in the 'AfterUpdate' event of a textbox in a form that needs to get the value from the output of a query and use it further down the code.
So i have a query (which works as expected) where the output fields are: PartID, ManufID, ManufPN.
Here is the SQL:
SELECT qryPartsToStock.PartID, qryPartsToStock.ManufID, qryPartsToStock.ManufPN
FROM qryPartsToStock
WHERE (((qryPartsToStock.ManufID)=[Forms]![frmPONumbers]![frmPOItems].[Form]![comboManufacturerID]) AND ((qryPartsToStock.ManufPN)=[Forms]![frmPONumbers]![frmPOItems].[Form]![comboManufacturerPN]));
I want to get the PartID field from the query results (query should only ever output one entry, or no entries but i should be able to handle that without too much trouble)
After much browsing online i keep hitting dead-ends...
Any suggesting on how i can get the PartID from the Query into a variable in my script?
Thankyou for any advice
I am trying to make a VBA script that will be in the 'AfterUpdate' event of a textbox in a form that needs to get the value from the output of a query and use it further down the code.
So i have a query (which works as expected) where the output fields are: PartID, ManufID, ManufPN.
Here is the SQL:
SELECT qryPartsToStock.PartID, qryPartsToStock.ManufID, qryPartsToStock.ManufPN
FROM qryPartsToStock
WHERE (((qryPartsToStock.ManufID)=[Forms]![frmPONumbers]![frmPOItems].[Form]![comboManufacturerID]) AND ((qryPartsToStock.ManufPN)=[Forms]![frmPONumbers]![frmPOItems].[Form]![comboManufacturerPN]));
I want to get the PartID field from the query results (query should only ever output one entry, or no entries but i should be able to handle that without too much trouble)
After much browsing online i keep hitting dead-ends...
Any suggesting on how i can get the PartID from the Query into a variable in my script?
Thankyou for any advice