Results 1 to 11 of 11

Thread: recordset.seek problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    14

    recordset.seek problem

    Private Sub Command2_Click()
    prompt$ = "enter name"
    searchstr$ = InputBox(prompt$, "seraching")
    datcontainer.Recordset.Index = "Konteyner"
    datcontainer.Recordset.Seek "=", searchstr$
    If datcontainer.Recordset.NoMatch Then
    MsgBox "Couldn't find", vbExclamation, "Result"
    datcontainer.Recordset.MoveFirst
    End If
    End Sub

    when i debug this code it shows (visual basic warning) No current records. I just want to use my own message. How can i disable visual basic warnnigs as i mentioned?
    i am getting crazy. i want to disable them. can anyone help me please???
    thanks...
    Last edited by odysseus; Aug 28th, 2005 at 08:09 AM.

  2. #2
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: recordset.seek problem

    What id "datcontainer". Is it a variable or a control?

    You may want to take a look at this link regarding The Seek Method.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    14

    Re: recordset.seek problem

    thanks for replying,
    but i looked at that page before. datcontainer is an access database.(like container.mdb)and the konteyner is a column in a table, which is in database(container.mdb) i am trying to manage it by visual basic. I wonder if i can disable visual baiscs' warnings or not. because i put a msgbox. i want to use it without another warnings. if u can help me i will be very appreciate.

    thanks.

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: recordset.seek problem

    This should do it.

    VB Code:
    1. If datcontainer.Recordset.NoMatch Then
    2.   MsgBox "Couldn't find", vbExclamation, "Result"
    3. else
    4.   datcontainer.Recordset.MoveFirst
    5. End If

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    14

    Re: recordset.seek problem

    thanks but it doesn't work again. the real problem is recordset.seek which shows "no current record" warning. it means it doesn't show only my msgbox. this important to me because when i save my project in executable form that warning makes my project ugly. that's the problem i am trying to solve.

    thanks

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: recordset.seek problem

    Can you check the .RecordCount property to see if it returns 0?
    What control are you using? Bound controls are evil. You should be using ADO.

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    14

    Re: recordset.seek problem

    .RecordCount returns 15.

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: recordset.seek problem

    You'll have to post some more code. Maybe the recordset is losing scope?
    It returns 15 in that click event? That would be odd. Im thinking it returns 15 somewhere else.

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: recordset.seek problem

    odysseus,

    I believe .Seek is DAO. Doesn't work with ADO.

  10. #10

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    14

    Re: recordset.seek problem

    I sent u find.zip that contains my project(in exe form and vba form.)there is an access database in it(find.mdb) that's the similiar database i use. and there is vb warning.jpeg i try to disable. If you have a chance to look at this, you will understand what i mean.

    thanks
    Attached Files Attached Files

  11. #11
    Hyperactive Member
    Join Date
    May 2005
    Posts
    324

    Re: recordset.seek problem

    I had a look. It's some behaviour of the bound control. See post #6. Data-bound controls are evil.

Posting Permissions

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



Click Here to Expand Forum to Full Width