If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Test for query returning no records
Access 2003. Trying to implement some VBA code (logic) to test if a query
returns zero records. It is not even clear for me how or what I test for. Obviously if the record count in the query results is zero then my condition has been found, but I am at a loss as to the "best" If statement to build to test for this. Is an empty (no records) query result considered a null set, and will the IsNull function test properly ? Thanks in advance for the great help always found here. |
#2
|
|||
|
|||
You can simply use DCount() function to check whether the Query returns any
row. Check Access VB Help on the DCount() function. -- HTH Van T. Dinh MVP (Access) "The Grape Hunter" wrote in message ... Access 2003. Trying to implement some VBA code (logic) to test if a query returns zero records. It is not even clear for me how or what I test for. Obviously if the record count in the query results is zero then my condition has been found, but I am at a loss as to the "best" If statement to build to test for this. Is an empty (no records) query result considered a null set, and will the IsNull function test properly ? Thanks in advance for the great help always found here. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Union query with left join | Abdula Zakaria via AccessMonster.com | Running & Setting Up Queries | 4 | April 23rd, 2005 11:58 AM |
Information from Table to Report | Dahlman | General Discussion | 6 | April 11th, 2005 09:57 PM |
Edit properties of linked subforms problem (repost) | Allen Browne | Using Forms | 3 | November 12th, 2004 08:16 PM |
Union Query returning Duplicate Records | Mike_Walrus | Running & Setting Up Queries | 1 | August 19th, 2004 09:40 PM |
New records can't be seen | rleblanc | Using Forms | 6 | August 14th, 2004 02:43 PM |