|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
thanx
"exit sub" was all i needed
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Error Handling |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|