PC Review


Reply
Thread Tools Rate Thread

Help with simple Send Event

 
 
Theresa
Guest
Posts: n/a
 
      11th Jul 2003
Ok, so I am doing some basic form validation using VBScripts functions...if
they dont resolve I set the send function to false...can anyone tell me why
it still sends??
Function Item_Send()

If not isNumeric(item.userproperties("cost center")) then

Item_Send = False

msgbox "Cost Center must be numeric"

End If

End Function


 
Reply With Quote
 
 
 
 
carl lorentson
Guest
Posts: n/a
 
      11th Jul 2003
I believe you need something like the code below. Note the use of the
Cancel parameter. (Source: Ms Outlook VB Ref | Events | Send Event)

Function Item_Send(Cancel)

If not isNumeric(item.userproperties("cost center")) then

Cancel = True 'Item_Send = False

msgbox "Cost Center must be numeric"

End If

End Function

Hope that works,
Carl Lorentson

"Theresa" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Ok, so I am doing some basic form validation using VBScripts

functions...if
> they dont resolve I set the send function to false...can anyone tell me

why
> it still sends??
> Function Item_Send()
>
> If not isNumeric(item.userproperties("cost center")) then
>
> Item_Send = False
>
> msgbox "Cost Center must be numeric"
>
> End If
>
> End Function
>
>



 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      11th Jul 2003
The form-level Item_Send event does not have a cancel parameter. Item_Send = False is the correct way to cancel the send. I would start my troubleshooting by adding a MsgBox statement to display the value of item.userproperties("cost center")

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.slipstick.com/books/jumpstart.htm


"carl lorentson" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> I believe you need something like the code below. Note the use of the
> Cancel parameter. (Source: Ms Outlook VB Ref | Events | Send Event)
>
> Function Item_Send(Cancel)
>
> If not isNumeric(item.userproperties("cost center")) then
>
> Cancel = True 'Item_Send = False
>
> msgbox "Cost Center must be numeric"
>
> End If
>
> End Function
>
> Hope that works,
> Carl Lorentson
>
> "Theresa" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Ok, so I am doing some basic form validation using VBScripts

> functions...if
> > they dont resolve I set the send function to false...can anyone tell me

> why
> > it still sends??
> > Function Item_Send()
> >
> > If not isNumeric(item.userproperties("cost center")) then
> >
> > Item_Send = False
> >
> > msgbox "Cost Center must be numeric"
> >
> > End If
> >
> > End Function
> >
> >

>
>

 
Reply With Quote
 
New Member
Join Date: Mar 2011
Posts: 1
 
      31st Mar 2011
Hello Carl,
I had the same issue. This seemed to work for me.


My Program:

Function Item_Send()
Dim objSum

Dim objPage
Set objPage = Item.GetInspector.ModifiedFormPages("Message")
Set objSum = objPage.Controls("TxtSum")

If Trim(objSum.Value) = "" Then
Item_Send = False
MsgBox("Please enter the Summary.")
objSum.Setfocus
Exit Function
End If

Your Program:

Function Item_Send()

If not isNumeric(item.userproperties("cost center")) then

Item_Send = False

msgbox "Cost Center must be numeric"

' I added this and it seemed to work perfectly for my program.
Exit Function

End If

End Function
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to Send Simple Email from a Simple Form; Using SMTP ryguy7272 Microsoft VB .NET 2 23rd Sep 2009 10:33 PM
Simple questions for simple 2 PC file sharing network. Simple? raylopez99 Microsoft Windows 2000 Networking 3 11th Feb 2007 02:31 PM
Event ID: 1003, Event Type: Error ,Event Source: System Error,Event Category: (102) BoazBoaz Windows XP General 0 21st Jun 2006 05:39 PM
Simple Simple Simple craigwojo Microsoft Excel New Users 3 29th Aug 2004 05:32 AM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:04 AM.