Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Row Count

Status
Not open for further replies.

kenman

Programmer
Dec 21, 2000
12
US
I have a subform that is displayed on a form. I have combo boxes that can be used to change the query criteria, as well as the filter applied to this subform. I would like to display how many records are in the subform. In fact, I would like to make the subform not visible, and just show a count of how many records there are in the subform. In other languages (i.e. powerbuilder) I can just look at datawindow.rowcount. Is there an easy way to do this? I know that I can create a dynaset and do it all internally....but I am so close...I just want a handle on the number of records in the subform so that I can display it.
Thanks in advance,

Ken
 
The following function will return the number of records in a subform. Change the controls to meet your criteria. It is caleed from somewhere in the main form.

Function getsubrecknt () returns long
Dim rs as recordset

Set rs = forms!PrimaryfrmName!subformcontainer.form.recordsource
rs.movelast
getsubrecknt = rs.recordcount
rs.close
set rs = nothing
end function

Robert Berman
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top