Tick box when query value is not null

clare_voiant

Board Regular
Joined
Mar 20, 2002
Messages
76
Hello again,

I have a query that checks postcodes against a list of 29000 postcodes. The query runs (via a macro on_exit) when the postcode is typed into the data entry form and opens on the screen in all its its glory to display the answer.....
But (and there's always a but!!!)

I dont want the query to be visible, I have a yes/no tickbox that i want ticking if the value of the query is not null.

any ideas?

your help, as always, is very much appreciated.

Clare
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,452
Office Version
  1. 365
  2. 2021
  3. 2016
Platform
  1. Windows
Hi Clare
You can determine whether or not the query has records or not (the null condition) but building a 2nd query based on the 1st query. The 2nd query is a count of the records returned in the first query except it returns a nil value instead of null. You can then test for the =0 or <>0 condition with your check box.
HTH, Andrew. :)
 

Forum statistics

Threads
1,181,612
Messages
5,930,921
Members
436,766
Latest member
azex85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top