All,
I have some lotus Script that is supposed to run only if a certain field is filled in. The script is basically creating a mail send using the Principal field. However, I have been unsuccessful in getting the code to run like I want it to as opposed to like it must be coded.
What I want it to do and thought it should do is to check to see if the field on the uidoc named ECONumber is filled in. If it is empty a Messagebox is to pop up and say you can’t do this then the agent stops. If the field is not empty it just continues on happily creating the mail message and filling in other items on it’s way.
What it is doing is not throwing any codes, and steps down to the End IF and regardless if the field is filled in.
Here is the part that is not working:
Dim checkit As Variant
checkit = uidoc.FieldGetText("ECONumber")
If Isempty(checkit) Then
'do something
boxType& = MB_OK + MB_ICONSTOP
answer% =Messagebox("You can not route a part for approval unless you have an ECO number.", boxType&, "No ECO Number")
End
Else
'do something else
End If
I have tried it with the following (I used “”, >, and < at different times) – This will stop the code regardless if the field is filled in or not.:
If uidoc.FieldGetText(“ECONumber”)(0) = “” Then
'do something
boxType& = MB_OK + MB_ICONSTOP
answer% =Messagebox("You can not route a part for approval unless you have an ECO number.", boxType&, "No ECO Number")
End
Else
'do something else
End If
So, Can someone point me in the correct direction? Thanks for any and all help.
Teri