ok heres what i'm stumped on:

I have a field called WorkOrderNo which contains either PM followed by digits, or some other letters followed by digits. I have another field called WorkOrderType which needs to be set to 2 if its a PM or 1 if its not a PM.

This has to be done in an append query expression, so I tried to do it, but it just doesn't work, I'm very new to append queries.

here is the code that I put together:

VB Code:
  1. if ((left ( WorkOrderNo, 2 )) = "PM") then WorkOrderType = "2"
  2. if ((left ( WorkOrderNo, 2 )) <> "PM") then WorkOrderType = "1"

Thank you in advance

-Dimava