Search For Record Macro Not Working

dmace1

Registered User.
Local time
Today, 06:08
Joined
May 3, 2019
Messages
15
Hi, I have a form in which I've put a search button to bring up a specific record. I want the user to only have to enter one word from a string of words (not necessarily the first word in the string).

This is what I have in the macro:

Object Type: Form
Object Name: InputCaseData
Record: First
Where Condition = :
"CaseTitle = ' "*" & [Forms]![InputCaseData]![SearchForBox] & "*" "

InputCaseData is the form name. SearchForBox is the text box to enter part the search term. CaseTitle is the field I'm searching for.

It's not working at all.

Can anyone help with this problem?

Thank you.
 
You might try the Like keyword instead of =
 
Thanks but that did not work either.
 
Thanks but that did not work either.
Hi. Can you show us exactly how you tried it? "Did not work" is not enough information to help us help you fix it.
 
Sure, this is what I put in the where condition.

"CaseTitle Like ' "*" & [Forms]![InputCaseData]![SearchForBox] & "*" "

When I clicked the run macro button, it did nothing.
 
Sure, this is what I put in the where condition.

"CaseTitle Like ' "*" & [Forms]![InputCaseData]![SearchForBox] & "*" "

When I clicked the run macro button, it did nothing.
Hi. Thanks. I don't use macros, so this is just a guess, but try:
Code:
"CaseTitle Like '*" & [Forms]![InputCaseData]![SearchForBox] & "*'"
Hope it helps...
 
Hi. Thanks. I don't use macros, so this is just a guess, but try:
Code:
"CaseTitle Like '*" & [Forms]![InputCaseData]![SearchForBox] & "*'"
Hope it helps...

That is what I would try as well
Code:
tt="test"
? "CaseTitle Like '*" & tt & "*'" 
CaseTitle Like '*test*
 
Walk through the macro as well, step by step
 

Users who are viewing this thread

Back
Top Bottom