I'm back again. I have a table called tblVendorItem, pretty much exactly the same as twinnyfo's, except I added another field called "VendorOrde r".
But the problem I'm having is when I put this table in a query and run this code in SQL:
I get an error message saying:
"Microsoft Access can't update all the records in the update query
Microsoft Access didn't update 70 field(s) due to a type conversion failure, 0 record(s) due to key violations, 0 record(s) due to lock violations, and 0 record(s) due to calidation rule violations.
Do you want to continue running this query anyway?
To ignore the error(s) and run the query, click Yes."
When I click "Yes" to ignore the errors, the VendorOrder field remains blank
What I'm trying to do with this query is check the vendorPriority for the lowest number and if the CanShipSameDay says "Yes", then the VendorOrder will show whatever is in the vendor field.
If the CanShipSameDay says "No", then the query will look in VendorPriority2 and so on.
Any idea on how to fix this?
But the problem I'm having is when I put this table in a query and run this code in SQL:
Code:
UPDATE tblVendorItem SET VendorOrder = IIf(VendorPriority=1, Vendor, IIf(VendorPriority=2, Vendor, IIf(VendorPriority=3, Vendor, IIf(VendorPriority=4, Vendor, IIf(VendorPriority=5, Vendor, " " ))))) WHERE CanShipSameDay = "Yes";
"Microsoft Access can't update all the records in the update query
Microsoft Access didn't update 70 field(s) due to a type conversion failure, 0 record(s) due to key violations, 0 record(s) due to lock violations, and 0 record(s) due to calidation rule violations.
Do you want to continue running this query anyway?
To ignore the error(s) and run the query, click Yes."
When I click "Yes" to ignore the errors, the VendorOrder field remains blank
What I'm trying to do with this query is check the vendorPriority for the lowest number and if the CanShipSameDay says "Yes", then the VendorOrder will show whatever is in the vendor field.
If the CanShipSameDay says "No", then the query will look in VendorPriority2 and so on.
Any idea on how to fix this?
Comment