I'm adding feature to my form. So if user input WO ID, the related fillings will be filled automatically.
First I'm trying to autofill the location.
On picture 1 if I choose ID 476 the location will be "CGK" as shown in picture 2.
The problem happen when I delete WO ID field then I tried to move to the next field.
There will be run time error asking to debug it as shown in picture 3.
Picture 4 is the code I'm using. The code works well if there is value in WO ID field.
Your suggestions would be appreciated...
(VBA Code)
Private Sub WO_ID_AfterUpdate()
Location = DLookup("[WO Location]", "[WO Query Inv No]", "ID =" & Forms![Equipment Maintenance]![WO ID])
End Sub