COUNTING

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to have a box on a form display the number of records found
macthing a query string. For example if I type in "qw" in the query the box,
on the form it will show X numbers of records matching that query string. IS
there a simple way of accomplishing this?... and would I be better if I used
a sub query to do the count?

Ray
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Easiest way is to use the DCount() function, on the query, in the record
count TextBox's ControlSource property. E.g.:

Control Source: =DCount("*","qryQueryName")

The TextBox will have to be requeried every time the "query box" is
changed. Use the query box's AfterUpdate event. E.g.:

Private Sub txtQuery_AfterUpdate()
Me!txtRecordCount.Requery
End Sub

Change the names of the controls to suite your set up.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQUhfyYechKqOuFEgEQKmRgCfX9Iqsq4s/s/FjhXAh5tGMLHXCcAAoJWr
9Gz8CLMXHSvxhxy3Ey4HR18u
=L/ZZ
-----END PGP SIGNATURE-----
 
Back
Top