I am trying ot create a table where multiple entries are based on the value of other fileds in the table. This is a table of products where each product has unique SKU and based on information contained within that SKU the manufacturer, type of item, and other properties can be ascertained. I would like the query to fill in the fields for Manufacturer, type, etc based on the SKU field. I have tried placing what i think should be the right VBA in the expression builder for that column but it isn't working. I am hoping that ther is a simple solution. It keeps telling me I am missing an operator or have invalid syntax. Here is wha t I have tried.
IF
[Inventory]![SKU] LIKE "MA" Then
"Manufacturer"
ELSE
"default"
END IF
if ther were only two possibilities I would use a IIf statement but there are about 50 possible entries for manufacturer. in the example above I am referencing the pre-existing inventory table where the SKu resides i have aslo tried Me![SKU] , SKU and Inventory.SKU I realy want this to only look for the manufacturers prefix in th first 3 characters of the SKU so I tried
IF Left([Inventory]![SKU],3) LIKE "MA" Then
"Manufacturer"
etc...
Is a query even the right place to put this code or should I be putting it directly in the column for the resulting table. The table will need to be updated periodically but there will never need to be a complete deletion and rebuild.
Any help is greatly apprecieated
IF
[Inventory]![SKU] LIKE "MA" Then
"Manufacturer"
ELSE
"default"
END IF
if ther were only two possibilities I would use a IIf statement but there are about 50 possible entries for manufacturer. in the example above I am referencing the pre-existing inventory table where the SKu resides i have aslo tried Me![SKU] , SKU and Inventory.SKU I realy want this to only look for the manufacturers prefix in th first 3 characters of the SKU so I tried
IF Left([Inventory]![SKU],3) LIKE "MA" Then
"Manufacturer"
etc...
Is a query even the right place to put this code or should I be putting it directly in the column for the resulting table. The table will need to be updated periodically but there will never need to be a complete deletion and rebuild.
Any help is greatly apprecieated