473,413 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Search in form for name

83
I have the names in my database as Last, First. I want to create a search that doesn't require you to put in the entire name with a comma. I think I want to use a like statement, but I can't get it to work.
Apr 20 '07 #1
12 1631
Rabbit
12,516 Expert Mod 8TB
What have you tried?
Apr 20 '07 #2
jl2886
83
What have you tried?
If Me.Insured_Name_2 > "" Then _
strFilter = strFilter & _
" AND ([Insured Name] Like '" & _
Me.Insured_Name_2 & "')"
Apr 20 '07 #3
Rabbit
12,516 Expert Mod 8TB
Like uses exact matching unless you use a wildcard such as:
Expand|Select|Wrap|Line Numbers
  1. Like "Bill*"
  2. Like "B*ill"
  3. Like "*Bill"
  4. Like "*Bill*"
Each one returns different results and there are more wildcard characters than just the *.
Apr 20 '07 #4
jl2886
83
Like uses exact matching unless you use a wildcard such as:
Expand|Select|Wrap|Line Numbers
  1. Like "Bill*"
  2. Like "B*ill"
  3. Like "*Bill"
  4. Like "*Bill*"
Each one returns different results and there are more wildcard characters than just the *.
Is there a way to just put in a string of letters Like "LEA" and it will find all names where LEA are in that order.
Apr 20 '07 #5
Rabbit
12,516 Expert Mod 8TB
Is there a way to just put in a string of letters Like "LEA" and it will find all names where LEA are in that order.
What do you mean by find all names where LEA are in that order. What order?
Apr 20 '07 #6
jl2886
83
I want to be able to type in a string of the name, I don't always know the last name, I don't always know the first name, but I want to be able to type somethign in....part of the name, part of the first name, part of the last name, then click enter and it will bring up all the cases based on the search

What do you mean by find all names where LEA are in that order. What order?
Apr 20 '07 #7
Rabbit
12,516 Expert Mod 8TB
That's what the wild cards are for.
Apr 20 '07 #8
jl2886
83
Lets try once more,
I would like to create a search in form, where I can type in all, or part of the name because I may not always spell it correctly, or know the full name. This is what I have so far.... I know it is an exact match, but how do I code to do what I want:
[code]Private Sub CheckFilter()
Dim strFilter As String, strOldFilter As String
strOldFilter = Me.Filter

If Me.Find_Insured_Name > "" Then _
strFilter = strFilter & _
" AND ([Insured Name]='" & _
Me.Find_Insured_Name & "')"

If strFilter > "" Then strFilter = Mid(strFilter, 6)
If strFilter <> strOldFilter Then
Me.Filter = strFilter
Me.FilterOn = (strFilter > "")
End If
End Sub
[\Code]
May 4 '07 #9
Tig201
103 100+
I'm not sure were your string is coming from but I was thinking you could do somthing Like
Expand|Select|Wrap|Line Numbers
  1. strFilter = "like *" & strFilter & "*"
this would search for anything with "strFilter" in it.
May 4 '07 #10
MMcCarthy
14,534 Expert Mod 8TB
As tig201 and Rabbit said you need the LIKE statement and wildcards.
Expand|Select|Wrap|Line Numbers
  1. If Me.Find_Insured_Name > "" Then _
  2.    strFilter = strFilter & _
  3.    " AND ([Insured Name] LIKE '*" & _
  4.    Me.Find_Insured_Name & "*')"
  5.  
May 6 '07 #11
jl2886
83
Thanks mccarthy!!!!

As tig201 and Rabbit said you need the LIKE statement and wildcards.
Expand|Select|Wrap|Line Numbers
  1. If Me.Find_Insured_Name > "" Then _
  2.    strFilter = strFilter & _
  3.    " AND ([Insured Name] LIKE '*" & _
  4.    Me.Find_Insured_Name & "*')"
  5.  
May 7 '07 #12
MMcCarthy
14,534 Expert Mod 8TB
Thanks mccarthy!!!!
You're welcome.
May 7 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Les Juby | last post by:
A year or two back I needed a search script to scan thru HTML files on a client site. Usual sorta thing. A quick search turned up a neat script that provided great search results. It was fast,...
2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
1
by: J P Singh | last post by:
Hi All I have been asked to build a search page to allow users to search the database. The issue is that the search page in ASP must mirror out existing search screen on the VB application. I...
3
by: AW | last post by:
Hi all, I have a form (named Offices) with a subform (named Occupants) that connect with the Master/Child Field "office number". I have a combo box that allows a user to pull up a particular...
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
3
by: ZafT | last post by:
Thanks for any help in advance. I am using this exact same piece of code on a server running PHP4, but for some reason when I run it on dreamhost using PHP5, the search does not register and it...
31
by: DWolff | last post by:
I'm somewhat new to Access, and have no VB experience at all (except for modifying existing code where obvious). I built a data entry form that works fine. Typically, a client will call in and...
1
Merlin1857
by: Merlin1857 | last post by:
How to search multiple fields using ASP A major issue for me when I first started writing in VB Script was constructing the ability to search a table using multiple field input from a form and...
5
by: Fran Jakers | last post by:
Hello all, I'm new to all this and I could really use some help. I've searched the web but cannot find an answer. I have an HTML form with 3 radio buttons and a search field that calls a...
12
by: iahamed | last post by:
Hi Everyone, I got two parts of my advance search to work, I am running out of Logic to connect the third. My mind is in swing! Pleaseeeeeeeee Help me. I have 3 Fiels to search, the First two...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.