Message box and words

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

Bill

i need a mesage box to pop up and tell you how many
records have a word like OPEN 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
 
Bill,

1. Create a query that only contaons the Order Status field and set the
criteria to Open
2. Create a recordset from the query
3. Use the RecordCount property of the recordset to get what you want
 
Dim i As Integer
Dim strMsg As String

i = DCOUNT("[Status]","tblOrders", _
"[status]='OPEN'")
strMsg = "There are currently " & i _
& " open orders."

MsgBox strMsg

Check the Help files for the details on the DCOUNT
function.

Hope this helps!

Howard Brody
 
Back
Top