G
Guest
I am trying to create a module so when I type in my product ID number the
serial number and description automatically fills in, but I am getting a
compile error: variable not defined. My code I wrote is:
Private Sub IDNo_AfterUpdate()
Dim varID, varSerialNo, varDescription As Variant
varIDNo = DLookup("IDNo", "tblIDNo", "IDNo =[IDNo] ")
varSerialNo = DLookup("SerialNo", "tblIDNo", "SerialNo =[SerialNo] ")
varDescription = DLookup("Description", "tblIDNo", "Description
=[Description] ")
If (Not IsNull(varIDNo)) Then Me![IDNo] = varIDNo
If (Not IsNull(varSerialNo)) Then Me![SerialNo] = varSerialNo
If (Not IsNull(varDescription)) Then Me![Description] = varDescription
End Sub
Please help - any help you can give would be appreciated. Thanks.
serial number and description automatically fills in, but I am getting a
compile error: variable not defined. My code I wrote is:
Private Sub IDNo_AfterUpdate()
Dim varID, varSerialNo, varDescription As Variant
varIDNo = DLookup("IDNo", "tblIDNo", "IDNo =[IDNo] ")
varSerialNo = DLookup("SerialNo", "tblIDNo", "SerialNo =[SerialNo] ")
varDescription = DLookup("Description", "tblIDNo", "Description
=[Description] ")
If (Not IsNull(varIDNo)) Then Me![IDNo] = varIDNo
If (Not IsNull(varSerialNo)) Then Me![SerialNo] = varSerialNo
If (Not IsNull(varDescription)) Then Me![Description] = varDescription
End Sub
Please help - any help you can give would be appreciated. Thanks.