D
Dan @BCBS
The user enters a number (in Me.txtMBR) and clicks the button for this code
and then the form opens with the information for that number.
If the number entered does not exist it opens a blank form. That is the
problem.
I am trying to add code to pop up a message saying no record found.
Could someone please help.
Private Sub Member_Click()
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.txtMBR) Then
MsgBox "You must enter a valid Member Number."
Exit Sub
Else
If Not (IsNull(Me.txtMBR)) Then
stLinkCriteria = "[MemberNo]=" & "'" & Me.txtMBR & "'"
End If
stDocName = "frmQualityData"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_Member_Click:
Exit Sub
Err_Member_Click:
MsgBox Err.Description
Resume Exit_Member_Click
End Sub
and then the form opens with the information for that number.
If the number entered does not exist it opens a blank form. That is the
problem.
I am trying to add code to pop up a message saying no record found.
Could someone please help.
Private Sub Member_Click()
Dim stDocName As String
Dim stLinkCriteria As String
If IsNull(Me.txtMBR) Then
MsgBox "You must enter a valid Member Number."
Exit Sub
Else
If Not (IsNull(Me.txtMBR)) Then
stLinkCriteria = "[MemberNo]=" & "'" & Me.txtMBR & "'"
End If
stDocName = "frmQualityData"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_Member_Click:
Exit Sub
Err_Member_Click:
MsgBox Err.Description
Resume Exit_Member_Click
End Sub