VB School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a VB Expert!

Join 307,110 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 2,018 people online right now. Registration is fast and FREE... Join Now!




run time error 5 :invalid procedure and call argument

 

run time error 5 :invalid procedure and call argument, run time error

samsonawane

5 Nov, 2009 - 01:34 AM
Post #1

New D.I.C Head
*

Joined: 23 Oct, 2009
Posts: 1

hi everyone this is sam
when run my application through exe that generates error something like "run time error 5 Invalid procedure and call argument" could anyone tell me what is this error and when this error occurs i am sending the code below:
CODE
Private Sub txtstdid_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
ElseIf txtstdid.Text = "S" Then
MsgBox "Please insert student ID"
Else
Dim sql As String
sql = "select * from student_details"
        r.Open sql, c, 3, 3
        Do While r.EOF = False
             If Trim(r!std_id) = Trim(txtstdid.Text) Then
                 MsgBox "This ID is exist you can not add this ID"
                 mode = 1
                 Exit Do
              End If
         r.MoveNext
         Loop
         r.Close
    If mode = 0 Then
     MsgBox "student Record does not exist if you want to add record fill all the information and click on add"
      txtfname.SetFocus
    End If
End If
End Sub

********************************************************
i could not found the error line it generates error when i runs an exe of the project. i am sending attachment file of full code that is stderror.txt
please help me

This post has been edited by samsonawane: 5 Nov, 2009 - 06:56 AM


Attached File(s)
Attached File  stderror.txt ( 4.86k ) Number of downloads: 12

User is offlineProfile CardPM
+Quote Post


NoBrain

RE: Run Time Error 5 :invalid Procedure And Call Argument

5 Nov, 2009 - 01:48 AM
Post #2

D.I.C Lover
Group Icon

Joined: 25 Mar, 2009
Posts: 1,214



Thanked: 39 times
Dream Kudos: 125
My Contributions
hi there smile.gif

can you show us on witch row is the error smile.gif

User is offlineProfile CardPM
+Quote Post

thava

RE: Run Time Error 5 :invalid Procedure And Call Argument

8 Nov, 2009 - 04:19 PM
Post #3

D.I.C Addict
Group Icon

Joined: 17 Apr, 2007
Posts: 905



Thanked: 52 times
Dream Kudos: 75
My Contributions
you should declare the record set like this
CODE

Dim r As New ADODB.Recordset
Dim c As New ADODB.Connection


i think this would solve your problem
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 01:05PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month