Help with search filter. (1 Viewer)

tssparky

Registered User.
Local time
Today, 03:56
Joined
May 24, 2017
Messages
23
what i have is a form button event that dims the vars and opens another form, passes the openArgs and performs a search.

The problem I'm having is the search is case sensitive so unless the case is correct i get no results. I have spent a bit of time on it and just can't work it out.. this is what i have..

Button_Click
Code:
Dim strpartnumber As String
strpartnumber = Me.[PartNumber]
 DoCmd.OpenForm "SOS_SEARCH_F2", acNormal, , , acFormEdit, _
     , strpartnum

Form_Load
Code:
 Dim strpartnum As String
    strpartnum = Forms!SOS_SEARCH_F2.OpenArgs
    If Len(strpartnum) > 0 Then
        DoCmd.GoToControl "PartNumber"
       
        DoCmd.FindRecord strpartnum, , True, , True, , True
        
    End If


So if i search for 1abc and the PartNumber 1ABC i get no results.

Thanks in advance for any help.

Regards

Nick
 

JHB

Have been here a while
Local time
Today, 12:56
Joined
Jun 17, 2012
Messages
7,732
Could you post your database with some sample data?
 

tssparky

Registered User.
Local time
Today, 03:56
Joined
May 24, 2017
Messages
23
Is there a way to force ignore case in a search?
 

Minty

AWF VIP
Local time
Today, 11:56
Joined
Jul 26, 2013
Messages
10,370
Access isn't case sensitive normally. Are you sure you are getting the wrong results?

Sent from my SM-G955F using Tapatalk
 

jdraw

Super Moderator
Staff member
Local time
Today, 06:56
Joined
Jan 23, 2006
Messages
15,377
You are using strPartnumber and strPartnum which may be a factor.
I agree with Minty re case insensitivity of Access by default.
I also suggest you post a copy of the database so we can "see" the issue directly.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:56
Joined
Oct 29, 2018
Messages
21,467
Hi Nick. Just curious, can you post the first couple of lines at the top of your form module? They should start out with “Option.”
 

Users who are viewing this thread

Top Bottom