Results 1 to 2 of 2

Thread: VB code to append query

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    VB code to append query

    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
    NXSupport - Your one-stop source for computer help

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Do a

    VB Code:
    1. Msgbox Left(workorderno,2)

    What do you get?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width