I have a subform inside of a form. For that subform, on its focus, I wish to run some code. I want the code to run a query:
SELECT ORDERS.SPL_HNDL AS SplHandling, ORDERS.[ORDER #] AS OrderNum, ORDERS.[CUSTOMER #] AS CustNum
FROM ORDERS
WHERE (((ORDERS.[ORDER #])=[Forms]![ORDERS INPUT FORM]![ORDER #]));
I then want to assign the results of SplHandling to a variable strSplHandling and the results of CustNum to a variable strCustNum and OrderNum to variable intOrderNum
Now, I want to do an if then statement like this:
if len(strComments) < 2 then
SELECT [SPL HNDL] FROM [CUSTOMER MASTER] WHERE ([CUST #] = 'strCustNum') and assign it to a variable called strSplHandlingCustMaster
UPDATE ORDERS SET SPL_HNDL = 'strSplhandlingCustMaster' WHERE (ORDER = intOrderNum)
end if
I know what needs to be done, and I can code it in other languages; however, I am not very good at VB...can anyone help please?
SELECT ORDERS.SPL_HNDL AS SplHandling, ORDERS.[ORDER #] AS OrderNum, ORDERS.[CUSTOMER #] AS CustNum
FROM ORDERS
WHERE (((ORDERS.[ORDER #])=[Forms]![ORDERS INPUT FORM]![ORDER #]));
I then want to assign the results of SplHandling to a variable strSplHandling and the results of CustNum to a variable strCustNum and OrderNum to variable intOrderNum
Now, I want to do an if then statement like this:
if len(strComments) < 2 then
SELECT [SPL HNDL] FROM [CUSTOMER MASTER] WHERE ([CUST #] = 'strCustNum') and assign it to a variable called strSplHandlingCustMaster
UPDATE ORDERS SET SPL_HNDL = 'strSplhandlingCustMaster' WHERE (ORDER = intOrderNum)
end if
I know what needs to be done, and I can code it in other languages; however, I am not very good at VB...can anyone help please?