Ok, I spent the better part of four hours looking at previous posts and trying various combinations of code and can’t come up with a solution.
I am using it for Asset Management and tracking of the warranty parts ordered for, installed, shipped back to the manufacturer. My form has two command buttons that lookup the Asset by item service tag or the RMA # from the manufacturer. The main form has all the information about the Asset in question (model, retire date, etc.). The subform shows all parts that have been ordered it, including all of the RMA numbers for the parts on order or previously installed. As the parts come in, I would like to scan the box and have it bring up the Asset it is assigned to showing all the parts in the subform.
My problem: I my have more than one RMA number in the subform and can’t figure out how to look up the Asset with the RMA#. I am trying to use DLookup to return the value of the service tag and put it into the Service Tag combo box lookup, but can’t get it work.
I am using it for Asset Management and tracking of the warranty parts ordered for, installed, shipped back to the manufacturer. My form has two command buttons that lookup the Asset by item service tag or the RMA # from the manufacturer. The main form has all the information about the Asset in question (model, retire date, etc.). The subform shows all parts that have been ordered it, including all of the RMA numbers for the parts on order or previously installed. As the parts come in, I would like to scan the box and have it bring up the Asset it is assigned to showing all the parts in the subform.
My problem: I my have more than one RMA number in the subform and can’t figure out how to look up the Asset with the RMA#. I am trying to use DLookup to return the value of the service tag and put it into the Service Tag combo box lookup, but can’t get it work.
Code:
Dim varX As Variable
DLookup("[ServiceTag]", "[tblPartsOrdered]", "[RMA_DPS] = " & Forms("frmParts")("[RMA_DPS]"))
Forms!frmParts![cboFindService] = varX