message box if no filter results

I have a unbound search text box on a form that has a table record source.  I also have a button that will execute a filter with the following macro builder code:

[PLU] Like "*" & Forms![Item_Master]!SearchFeild & "*"



I want to display a message box if no filter results are found.  How can I do this?
tike55Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
place this codes before you apply the filter,
change "NameOfTable or Query" with the actual name of table or query

if dcount("*", "NameOfTable or Query", "[PLU] Like "*" & Forms![Item_Master]!SearchFeild & "*") =0 then
msgbox "No records to show"
exit sub
end if
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tike55Author Commented:
If I select the bottom row (empty row that has an * in the first field) in the lower half of the split form, the form clears and the filter and messagebox functions correctly .  If any other record is selected on the bottom of the form a  message box pops up for everything.

 Is there any way to add some vba code that will select the bottom empty row and clear the form everytime someone hits the button to execute the filter?
0
tike55Author Commented:
Figured it out! go to new record
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.