Script to check a Sales Order in and out of an area

SOLVED

First of all disclaimer:  I am not a coder so I don't completely grasp what's going on with the code below, but I have been tasked with trying to make this work, so any help is appreciated.


We have a script that is used to user and date/time stamp UDF fields on a custom tab we created on Sales Order.  This has worked for a long time.  Now I need to add to the script to have it do a date/time stamp for when the order leaves a certain area.  This will only do the date/time stamp as the user is stamped when the order enters the area 


The script looks like this.

DIM dt
dt = DATE() & " " & TIME()
if SO_SalesOrder_bus_UDF_10_ORD_REC = "" THEN
    SO_SalesOrder_bus_UDF_10_ORD_REC = dt
    SO_SalesOrder_bus_UDF_10_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_20_ORDENTRY = "" THEN
    SO_SalesOrder_bus_UDF_20_ORDENTRY = dt
    SO_SalesOrder_bus_UDF_20_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_50_CUSTOMER_CAL = "" THEN
    SO_SalesOrder_bus_UDF_50_CUSTOMER_CAL = dt
    SO_SalesOrder_bus_UDF_50_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_70_OCPSI = "" THEN
    SO_SalesOrder_bus_UDF_70_OCPSI = dt
    SO_SalesOrder_bus_UDF_70_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_75_HDWR_REV = "" THEN
    SO_SalesOrder_bus_UDF_75_HDWR_REV = dt
    SO_SalesOrder_bus_UDF_75_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_80_ORD_ENTRY_2 = "" THEN
    SO_SalesOrder_bus_UDF_80_ORD_ENTRY_2 = dt
    SO_SalesOrder_bus_UDF_80_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_90_MFG_PRINT = "" THEN
    SO_SalesOrder_bus_UDF_90_MFG_PRINT = dt
    SO_SalesOrder_bus_UDF_90_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_120_BOMWO = "" THEN
    SO_SalesOrder_bus_UDF_120_BOMWO = dt
    SO_SalesOrder_bus_UDF_120_USER = MAS_SCR_USR
ELSEIF SO_SalesOrder_bus_UDF_130_REL_MFG = "" THEN
    SO_SalesOrder_bus_UDF_130_REL_MFG = dt
    SO_SalesOrder_bus_UDF_130_USER = MAS_SCR_USR
END IF


However when I try and add the following to try and get it to put the Date/Time stamp to have the order move out of the area in question which I added as suchas

ELSEIF SO_SalesOrder_bus_UDF_75_HDWR_REV_OUT = "" THEN
               SO_SalesOrder_bus_UDF_75_HDWR_REV_OUT = dt

It doesn't work.  I put this in between the code that checks it in to that stage, and before the next stage check-in.  When I do this, it stops at that code and won't go on.

Any help would be appreciated.


Thanks!

Mary Ayala