This is a follow up to a previous question, again exposing my lack of knowledge.
The first part below to update a table worked properly, thanks for that.
I now want to use NewCaskID from the InputBox as criterion for a query, to extract a related value GyleID.
The SELECT statement for the query in normal Design View is
It needs the condition " WHERE CaskID = " & NewCaskID
A final step would be to display this on the form initiating the whole procedure, in an unbound field [ExpectedGyle]
The first part below to update a table worked properly, thanks for that.
Code:
Dim NewCaskID As Long
NewCaskID = InputBox("Enter Cask Number")
strSQL = "UPDATE [Casks Racked/Sold] SET OrderDetailID = " & forms!frmBookOut.OrderDetailID & " WHERE CaskID = " & NewCaskID
Debug.Print strSQL
DoCmd.RunSQL strSQL
I now want to use NewCaskID from the InputBox as criterion for a query, to extract a related value GyleID.
The SELECT statement for the query in normal Design View is
Code:
SELECT [Casks Racked/Sold].GyleID, [Casks Racked/Sold].CaskID
FROM [Casks Racked/Sold];
It needs the condition " WHERE CaskID = " & NewCaskID
A final step would be to display this on the form initiating the whole procedure, in an unbound field [ExpectedGyle]