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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counter On Continuous form 1

Status
Not open for further replies.

kevinf2349

Technical User
Sep 12, 2002
367
US
Hi

I have a pretty simple form that is set up as a continuous form. It is a list of department names in the table tblDept. I would like to add a counter to each displayed record that is a count of records where the department ID matches the one displayed but in table tblContact.

I know that continuous forms are pretty restrictive so I am not sure if this is even possible....any ideas?
 
use a static variable to count. Something like this will be close

make text box and place
=Countrecs() as its control source

this in the forms module

Private Function Countrecs() As Integer
Static lngX As Long
lngX = lngX + 1
If lngX > Me.RecordsetClone.RecordCount Then lngX = 0
Countrecs = lngX
End Function
 
Thanks for the pointer. It is now working like a charm :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top