Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Exit Function and MsgBox

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,235
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Exit Function and MsgBox
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Exit Function and MsgBox - 7/2/2001 9:53:04 PM   
  nukeboy

 

Posts: 10
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
My code is below, my problem is that I'm recieving two consecutive
message boxes, when I only want one. I know the code is a little
screwy but I've been playing with is trying to figure this out. Any
suggestions?

Thanks

Function CustomerID_Blur()
CustomerID_Blur = False
If frmMain.CustomerID.Value <> "" then
If Len(frmMain.CustomerID.value) <> 15 Then
msgbox "CustomerId must be 15 digits.", vbcritical,
"Intell-A-Check"
Exit Function
Else
If Not IsNumeric frmMain.CustomerID.value) then
msgbox "CustomerId must be 15 digits.", vbcritical,
"Intell-A-Check"
Exit Function
Else
CustomerID_Blur = True
Exit Function
End If
End If
Else
Exit Function
End If

End Function
 
 
Post #: 1
 
 Re: Exit Function and MsgBox - 7/2/2001 9:56:43 PM   
  gold7

 

Posts: 10
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
Ooops, I forgot to add that this doesn't happen on the Blur it happens
when the Submit routine calls the blur.

(in reply to nukeboy)
 
 
Post #: 2
 
 Re: Exit Function and MsgBox - 7/2/2001 9:58:59 PM   
  dropme

 

Posts: 18
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
You don't need to use "Exit function". because your If statements are
correctly written then it should flow the end of the function anyway.

You're only as good as your last answer!

(in reply to nukeboy)
 
 
Post #: 3
 
 Re: Exit Function and MsgBox - 7/2/2001 9:59:39 PM   
  dropme

 

Posts: 18
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
is another object getting focus when the submit calls the blur. because
then when the object loses focus it calls the blur function and when
another object calls the blur function it will run again (twice) Post
more code so I have more of an Idea of what you are trying to do.

(in reply to nukeboy)
 
 
Post #: 4
 
 Re: Exit Function and MsgBox - 7/2/2001 10:00:43 PM   
  gold7

 

Posts: 10
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
Actually I figured out that the calling routine was calling it twice.

It was calling the function:

CustomerID_Blur()

Then evaluating it, and calling it again:

if CustomerID_Blur = False then ....

But thanks for your help!

(in reply to nukeboy)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Exit Function and MsgBox Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts