Cancel the send function

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...
 
A

Ashutosh Varshney

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top