G
Guest
I am trying to create a module in which when I type in the ID Number the
serial number and description automatically fills in. Here is the module I
wrote but it is not working - I am getting a compile error message.
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
serial number and description automatically fills in. Here is the module I
wrote but it is not working - I am getting a compile error message.
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