On the main form is a combo box (cboProductID). The user selects an item in the combo box and an SQL Insert statement inserts the item into a subform of the main form.
I am trying to determine the ProductTypeID of the item that has been inserted into the subform and am trying to use this statement but it is not working and I believe the problem is with how I am referring to the cboProductID.
Here is the statement that is not working;
iProdType = DLookup("ProductTypeID", "tblProduct", "ProductID = " & Forms.Parent.cboProductID.Value)
(this is in the After_Update event) of one field of the inserted record.
In attempting to solve the problem I replicated it in SQL;
Expr1: DLookUp("ProductTypeID","tblProduct","ProductID = Forms![frmBooking]![cboProductID].[value]")
And this works but unfortunately doesn't help me with iProdType declaration.
What do you think the problem could be with the declaration statement?
I am trying to determine the ProductTypeID of the item that has been inserted into the subform and am trying to use this statement but it is not working and I believe the problem is with how I am referring to the cboProductID.
Here is the statement that is not working;
iProdType = DLookup("ProductTypeID", "tblProduct", "ProductID = " & Forms.Parent.cboProductID.Value)
(this is in the After_Update event) of one field of the inserted record.
In attempting to solve the problem I replicated it in SQL;
Expr1: DLookUp("ProductTypeID","tblProduct","ProductID = Forms![frmBooking]![cboProductID].[value]")
And this works but unfortunately doesn't help me with iProdType declaration.
What do you think the problem could be with the declaration statement?
Last edited: