|
-
Sep 27th, 2003, 11:11 AM
#1
Thread Starter
New Member
SORRy for being pathetic. but i need help
how can i handle errors here? i encounter lots of em.
also, im very sorry. im only a self-taught student and am just starting out. so please be patient. TIA.
VB Code:
Private Sub datPrimaryRS_Error(ByVal ErrorNumber As Long, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, fCancelDisplay As Boolean)
'This is where you would put error handling code
'If you want to ignore errors, comment out the next line
'If you want to trap them, add code here to handle them
End Sub
-
Sep 27th, 2003, 07:51 PM
#2
Wendy_Clear
Lots of errors? Just what kind of errors do you get?
-
Sep 27th, 2003, 10:42 PM
#3
Thread Starter
New Member
it says "errors occured".
-
Sep 27th, 2003, 11:02 PM
#4
Wendy_Clear
It always helps to have the complete error message and what you were doing at the time, Even the section of code you were in would help.
A vague question gets a vague answer.
-
Sep 28th, 2003, 04:57 AM
#5
Thread Starter
New Member
its like this. when i start the program, it says "Type Mismatch" which is directed to my validation code for the program. after that, it says "Invalid Procedure Call or Arguement". Then when i do something like saving a record, it says "Errors Occured" but still saves my record. why is this? i cant find anything wrong with my code...
VB Code:
Private Sub Adodc1_WillMove(ByVal adReason As ADODB.EventReasonEnum, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error GoTo error
'If save = True Or Action = vbDataActionUpdate Or Action = vbDataActionUnload Or Action = vbDataActionAddNew Or Action = vbDataActionMoveNext Or vbDataActionMoveLast Or vbDataActionMoveFirst Or vbDataActionMovePrevious Then
'pilyido
If txtln = "" Then
strMsg = "You must enter last name!" & Chr(13)
txtln.SetFocus
End If
'ngalan
If txtfn = "" Then
strMsg = "You must enter first name!" & Chr(13) & strMsg
txtfn.SetFocus
End If
...
If txtcn1 = "" And txtcn2 = "" Then
strMsg = "Must enter at least one contact number!" & Chr(13) & strMsg
txtcn1.SetFocus
End If
If txtrn = "" Then
strMsg = "Must enter a record number!" & Chr(13) & strMsg
txtrn.SetFocus
End If
If strMsg <> "" Then
enumMsgResult = MsgBox(strMsg, vbExclamation + vbOKCancel + vbDefaultButton1)
adStatus = adStatusCancel
End If
Exit Sub
error:
MsgBox Err.Description
-
Sep 28th, 2003, 11:34 AM
#6
Wendy_Clear
No much info. What you can do is to open your project in VB. Go to Tools->Options->General and select to Break on All Errors. Then run your program and see where it stops. Then I would have a reference to what exactly is the start of your problems.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|