How to avoid Null's in VBA

Quite interesting. A recordset will always return a record count of 1 when an aggregate function is used in an sql statement. You can test this out for yourself, Debug.Print the sqlstring generated and put in the sql view of a test query. You will find that the record count at the bottom is zero. Do this for when there's no data, for example when memberadpk = 0.

For further testing, you can save that test query and instead of doing a SELECT statement, just put the name of the query in there, then see that the record count will be different. Even the BOF and EOF properties both return False.

Nice, you can sleep well at night then :)
 

Users who are viewing this thread

Back
Top Bottom