Solved wildcards with a parameter (Mach Case) (1 Viewer)

Sarah.M

Member
Local time
Today, 09:30
Joined
Oct 28, 2021
Messages
335
Hi, Plz note, My VBA is disabled for security reason.
I can use only Expression builder, Macros, Queries, Tables, Forms and Reports only.
------------------------------------------------
I have a macro event ApplyFilter, I this to write code to Mach Case at Where condition
I have this code and it is working good [Expr1] Like "*" & [Forms]![SearchF]![Txtbox] & "*", but I want it to Mach the case exactly
My tries but they did not work
[Expr1] Like [Forms]![SearchF]![Txtbox]
[Expr1] Like [Forms]![SearchF]![Txtbox] & "*"
[Expr1] Like "*" & [Forms]![SearchF]![Txtbox]
[Expr1] Like "*" [Forms]![SearchF]![Txtbox] "*"
[Expr1] Like "[" [Forms]![SearchF]![Txtbox] "]"

plz help!
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:30
Joined
May 7, 2009
Messages
19,230
can you use Instr() function:
the last parameter of the function (0 = vbBinaryCompare).

Instr(1, [Expr1], [Forms]![SearchF]![Txtbox], 0) <> 0
 

Sarah.M

Member
Local time
Today, 09:30
Joined
Oct 28, 2021
Messages
335
can you use Instr() function:
the last parameter of the function (0 = vbBinaryCompare).

Instr(1, [Expr1], [Forms]![SearchF]![Txtbox], 0) <> 0
Thank you for your reply,
No, I want to Match exact number
For example I put 77 I got 3 records, I should get only 1 record
Sample attached
p.png
 

Attachments

  • Search.accdb
    444 KB · Views: 332

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:30
Joined
May 7, 2009
Messages
19,230
you can use = sign:

[Expr1] = [Forms]![SearchF]![Txtbox]
 

Users who are viewing this thread

Top Bottom