G
Guest
Where a table acts as the record source for a form, the records are normally selected via an SQL statement or a query. The criteria associated with the latter determine which records are chosen. Normally these will represent a subset of those present in the source table
I have a number of forms where I need to calculate the number of records selected by the SQL statement or query. This figure is, of course, displayed in the navigation bar total but is not accessible to the form designer. Since this number is dynamically variable, I am finding some difficulty in writing appropriate VBA code to return the desired value. Could someone please oblige me? It would be particularly convenient if the source SQL statement or query could be made to return the total number of records selected. DCount at first seemed a likely candidate but appears to be ruled out by the fact that the source queries, for the forms in which I am interested, generally take variable parameters
I have a number of forms where I need to calculate the number of records selected by the SQL statement or query. This figure is, of course, displayed in the navigation bar total but is not accessible to the form designer. Since this number is dynamically variable, I am finding some difficulty in writing appropriate VBA code to return the desired value. Could someone please oblige me? It would be particularly convenient if the source SQL statement or query could be made to return the total number of records selected. DCount at first seemed a likely candidate but appears to be ruled out by the fact that the source queries, for the forms in which I am interested, generally take variable parameters