runtime error 3001 in vb 6.0-VBForums
Results 1 to 2 of 2

Thread: runtime error 3001 in vb 6.0

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    2

    runtime error 3001 in vb 6.0

    Please any one help to solve this problem

    i am using vb 6.0 and ms-access

    in my project the primary key is Alpha Numeric Type
    ( Ex. Vehicle no. TN09x 5186)

    i set the Primary field at data tye in ms access - Text

    when i run the following Find Code the Following Error will occured

    " RnnTime Error '3001' Arguments are of the wrong type, are out of accepted range, or are in conflict with one another"

    Private Sub Find_Click()
    Dim A As String
    A = InputBox("ENTER VEH.NO")

    rs.MoveFirst

    rs.Find "vehno=" & A

    If rs.EOF Then
    MsgBox "Record not Found"
    Else
    rs.Delete
    MsgBox "successfullu deleted"
    End If

    End Sub

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    37,039

    Re: runtime error 3001 in vb 6.0

    In SQL statements (and thus .Find too), text/char values need single quotes around them, eg:
    Code:
    rs.Find "vehno='" & A & "'"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.