Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old October 25th, 2004, 05:18 AM
x_c4_4u x_c4_4u is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Zimbabwe
Posts: 34 x_c4_4u User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 10 m 15 sec
Reputation Power: 4
Send a message via Yahoo to x_c4_4u
Question Error Handling

i have an error handler which is giving me an empty message box after displaying a predefined message box. ie there are two message boxes but the second one has nothing on it. Pliz debug this code.




Private Sub cmdUpdate_Click()
On Error GoTo ras
'check for date,customer,video and trans b4 updating
If (Text1.Text <> "" And Text2.Text <> "") And (Text3.Text <> "" And Text5.Text <> "") Then
If IsNumeric(Text1.Text) = True Then
rs.Move 0
rs.Update
msg = MsgBox("Record Updated...Do you want to enter another Transaction?", vbYesNo, "Record Updated")
Select Case msg
Case vbYes
rs.AddNew
Text5.Text = DTPicker1.Value + 3
Case vbNo
Unload Me
End Select
Else
MsgBox ("Enter numeric values for the Transaction Id in the format 0001"), vbCritical, "Incorrect Format"
End If
Else
MsgBox ("You did not enter all the required fields. Please fill in all the necessary Details"), vbCritical, "Incomplete Record"
End If

ras:
MsgBox (Err.Description), vbOKOnly, "Data Entry Error"



End Sub

Reply With Quote
  #2  
Old October 25th, 2004, 05:22 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 18 h 33 m 48 sec
Reputation Power: 180
Have you tried stepping through your code in the debugger? I doubt it executes in the order you expect.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old October 26th, 2004, 07:02 PM
KenVandergriff KenVandergriff is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 23 KenVandergriff User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 8 sec
Reputation Power: 0
I noticed that you do not have anything to keep your program from executing into the error handler even if there is not an error.



Try putting Exit Sub immediately before your ras: statement.

Reply With Quote
  #4  
Old October 28th, 2004, 02:09 PM
x_c4_4u x_c4_4u is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Zimbabwe
Posts: 34 x_c4_4u User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 10 m 15 sec
Reputation Power: 4
Send a message via Yahoo to x_c4_4u
thanx

"exit sub" was all i needed

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Error Handling


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway