469,072 Members | 1,804 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,072 developers. It's quick & easy.

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 790

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
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.