Cancel the send function

  • Thread starter Thread starter Greg Smith
  • Start date Start date
G

Greg Smith

Here is the code:

Function Item_Send()
If Item.userproperties("To") = "" Then
MsgBox "You Must Select A Recipient Prior
To Selecting The Email Button." &
vbLf,vbInformation , "WARNING: NO RECIPIENT SELECTED"
Stop Function
End If

If Len(Item.userproperties("Subject").value) < 16
Then
Msgbox "You Must Complete The Form Prior
To Selecting The Email Button.", vbInformation , "WARNING:
BLANK SUBJECT"
Stop Function
End If
End Function

==========================================================
How do I get it to cancel the function is the criteria is
not met? I do not want it to send...
 
Try changing the Stop Funtion like...

Item_Send = False
Exit Function

If that still does not work, there are a few things you
should check:

1. Sometimes the form cache gets corrupted. Make sure that
you looking at the correct form... Like change form
version before publishing, then when you load the form
check its version... that way you can be certain.
2. Check the entire code for any syntax errors.
3. Make sure that you do not have any other Send event
handlers on the form.

HTH

AV
 
Back
Top