pdvsa
asked on
Append Query - key violation
Experts,
I have narrowed down an error in my append query (pic attached)
The error is associated with this column (pic attached):
LCType: Switch([Nature] Like "PB*",22,[Nature] Like "APB*",25,[Nature] Like "PC*",18,[Nature] Like "Misc*",19,[Nature] Like "Surety*",42,[Nature] Like "BB*",23,[Nature] Like "HP*",43,True,"")
If I delete the column then it Appends with no issues and no errors and therefore I believe the issue is with this column only.
The numbers in the SWITCH correspond to LC names (in tbLCTypeDropBox) such as for example:
22 = SB - Performance LC and so on for the remaining numbers
tblLetterOfCredit.LCType is a combo box with this as the row source:
SELECT tblLCTypeDropbox.ID, tblLCTypeDropbox.LCType FROM tblLCTypeDropbox;
and LCTypeDropBox is a table with various ID's associated with LC types (such as ID 22 = SB - Performance LC as explained earlier.
How can I avoid this error?
thank you
I have narrowed down an error in my append query (pic attached)
The error is associated with this column (pic attached):
LCType: Switch([Nature] Like "PB*",22,[Nature] Like "APB*",25,[Nature] Like "PC*",18,[Nature] Like "Misc*",19,[Nature] Like "Surety*",42,[Nature] Like "BB*",23,[Nature] Like "HP*",43,True,"")
If I delete the column then it Appends with no issues and no errors and therefore I believe the issue is with this column only.
The numbers in the SWITCH correspond to LC names (in tbLCTypeDropBox) such as for example:
22 = SB - Performance LC and so on for the remaining numbers
tblLetterOfCredit.LCType is a combo box with this as the row source:
SELECT tblLCTypeDropbox.ID, tblLCTypeDropbox.LCType FROM tblLCTypeDropbox;
and LCTypeDropBox is a table with various ID's associated with LC types (such as ID 22 = SB - Performance LC as explained earlier.
How can I avoid this error?
thank you
ASKER
also, I can still Append if I click the Yes button but that column [tblLetterOfCredit].[LCTpe ] will be Null.
ASKER
tblLetterOfCredit.LCType is Number format
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
wow. You are good. That was exactly the issue. It works perfectly.
thank you
thank you
ASKER