Code:
PrivateSub cboAsiaNoticeServiceContractCustomer_LostFocus()
If [cboAsiaNoticeShipLine] = "FE APL" And[cboAsiaNoticeServiceContractCustomer] = "AMERINA, INC." Then
[AsiaNoticeContractNumber] = "N/C"
ElseIf [cboAsiaNoticeShipLine] = "FE Maersk" And[cboAsiaNoticeServiceContractCustomer] = "AMERINA, INC." Then
[AsiaNoticeContractNumber] = "627157"
ElseIf [cboAsiaNoticeShipLine] = "FE MOLU" And[cboAsiaNoticeServiceContractCustomer] = "AMERINA, INC." Then
[AsiaNoticeContractNumber] = "US0000280"
EndIf
End Sub
I'm looking for a better way to rewrite this code, because contract numbers change frequently it's become a pain to have edit the code.
So my thought was to create a Lookup table containing , AsiaNoticeShipLine, AsiaNoticeServiceContractCustomer and AsiaNoticeContractNumber.
Now that I have table with data, I looked at using Dlookup, but couldn't see how to use it with a Lookup table.
I thought there might be a way to modify the current VBA code todo the lookup, but don't have the enough experience with VBA to know.
Thank you in advance for any and all suggestion
OldCityCat