update or make table? one filed based on another.

Joined
Apr 18, 2007
Messages
1
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top