How to create a semantic search box and engines?

Can anyone tell me how to create a search box using visual basic that will search a data base?

  • I'm bit of a novice when it comes to program using visual basic. I have my vb program set up and my database as well. In my program I have a Search command button that will show an inputbox that will enable me to type what I want to search the database for. i.e. the membership number of a customer. The code for my search button is below: Private Sub cmdSearch_Click() Dim searchvar As String searchvar = InputBox("Enter the Membership Number you wish to find", "Fitness Freaks Search") With adoMembers.Recordset Dim bMark As Variant bMark = .Bookmark .MoveFirst .Find "MembershipNumber = '" & searchvar & "%'" If .EOF Or .BOF Then .Bookmark = bMark MsgBox "Membership Number " & searchvar & " not found." End If End With End Sub When I execute this I get an error message (3265). Can anyone help me? Thanks tmcpolin

  • Answer:

    3625 is an "Item not found in this collection" error. It can be a couple things: EOF not being handled correctly or Sometimes column name not found in that table, which might be syntax. Try using a loop to check EOF and see if this 'Find' syntax works better: searchvar = searchvar & "%" **this simplifies your Find statement Do Until adoMembers.Recordset.EOF = True adoMembers.recordset.Find "[Membership Number] = ' " & searchvar & " ' " Loop I put spaces between the ' and " for visibility..take them out hope that helps

tmcpolin at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.