View Full Version : Counting the displayed records in a sub form.


Nigel Fowle
08-22-2000, 05:17 PM
I have a form that displays the first record that matches the query. However if there is more than one record matching the query, the multiple records are displayed in a sub form of the main form.
Is there a way of counting the records in the sub form so that it can be blanked out if there is only one match ?

Jack Cowley
08-22-2000, 05:29 PM
You can put this code in the appropriate place in your form and it should do what you want...

If DCount("*","QueryName") >= 2 then
Show your Subform
End if

HTH,
Jack

Nigel Fowle
08-23-2000, 12:24 PM
Thanks Jack, after a bit of fiddling the DCount function works fine - Cheers.