Dates and a message box

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

how can i count a word in a field like OPEN and have a
mesage box pop up and tell you how many records have that
word in them. In other words i would like a message box
that tells how many records have the word OPEN in an
Order Status Field the field would also have words like
CLOSED, PENDING, IN REVIEW ect... But i only want to
count the records with OPEN in that field.
Thanks Bill
 
Use a query to select only the records that have the required value. In
code, you can open and populate the a recordset based on the query, and use
the RecordCount property to determine the number of matching records:

Dim rs as Recordset
Set rs = CurrentDB.OpenRecordset("FilterQueryName")
rs.MoveLast

MsgBox.Show ("There are " & rs.RecordCount & " open records.")


HTH

--
Rebecca Riordan, MVP

Designing Relational Database Systems
Microsoft SQL Server 2000 Programming Step by Step
Microsoft ADO.NET Step by Step

http://www.microsoft.com/mspress

Blessed are they who can laugh at themselves,
for they shall never cease to be amused...
 
Back
Top