Results 1 to 2 of 2
  1. #1
    SKUPenn is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    1

    Creating a Search Field

    I am trying to create a search field within my database that will open a form to a particular record. Since the search field is for a name, I want it to be able to recognize partial matches (eg. “smit”=”smith”).


    I am a real beginner with VBA. I’ve previously used the following program to retrieve a form based on an ID number which only returns exact matches:
    Private Sub FindRecord_Click()
    On Error GoTo Err_FindRecord_Click

    Dim stDocName As String
    Dim stLinkCriteria As String



    stDocName = "ContactForm"

    stLinkCriteria = "[familyid]=" & "'" & Me![Text0] & "'"
    DoCmd.Close
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_FindRecord_Click:
    Exit Sub

    Err_FindRecord_Click:
    MsgBox Err.Description
    Resume Exit_FindRecord_Click

    End Sub

    How would I alter this to do a “wildcard” type of search of an unbound text box that will find names or part of names?

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Search Access Help for "wildcards".

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Creating User friendly Search Forms
    By BernardKane in forum Forms
    Replies: 7
    Last Post: 01-29-2010, 11:28 AM
  2. Replies: 3
    Last Post: 01-14-2010, 08:32 AM
  3. How to Search a Text Field in Access
    By cnbhold in forum Access
    Replies: 1
    Last Post: 01-11-2010, 05:56 PM
  4. Replies: 5
    Last Post: 07-26-2009, 12:13 PM
  5. Search All Field
    By robbiebrown34 in forum Access
    Replies: 0
    Last Post: 05-17-2007, 09:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums