Hi
I am trying to get a Message Box if there are No Records in a Form, here is the code.
thank you in advance
Pretty

VB Code:
  1. Private Sub Command40_Click()
  2. On Error GoTo Err_Command40_Click
  3. Dim stDocName As String
  4. Dim stLinkCriteria As String
  5. Dim intHolder As Integer
  6. intHolder = DCount("UnitAreaName", "qryMainDue")
  7. If intHolder > 0 Then
  8. stDocName = "frmDue"
  9. DoCmd.OpenForm stDocName, , , stLinkCriteria
  10. Else
  11. MsgBox "There are no records!"
  12. End If
  13. Exit_Command40_Click:
  14. Exit Sub
  15. Err_Command40_Click:
  16. MsgBox Err.Description
  17. Resume Exit_Command40_Click
  18. End Sub