472,097 Members | 1,058 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

run code to see if a query has results

I have a query that compares two different tables, I have a button on a form that will open the query but I only want the query if it has results. I don't want it to open if the results are null. just have a message box pop up stating there are is no data.
I am thinking: if qry1=null then msgbx "no results" else docmd.openquery "qry1"
Sep 8 '16 #1
0 841

Post your reply

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

Similar topics

1 post views Thread by Guy Erez | last post: by
reply views Thread by leo001 | last post: by

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.