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:
Private Sub Command40_Click() On Error GoTo Err_Command40_Click Dim stDocName As String Dim stLinkCriteria As String Dim intHolder As Integer intHolder = DCount("UnitAreaName", "qryMainDue") If intHolder > 0 Then stDocName = "frmDue" DoCmd.OpenForm stDocName, , , stLinkCriteria Else MsgBox "There are no records, therefore the request has been cancelled" End If Exit_Command40_Click: Exit Sub Err_Command40_Click: MsgBox Err.Description Resume Exit_Command40_Click End Sub


Reply With Quote