P
Peter
Hi all…sorry for bothering you all time, but I am not “getting†it..
Below code returns Error highlighted DoCmd.OpenForm stDocName, , ,
stLinkCriteria and the MsgBox does not “fire†if [CaseID] is left empty…
Private Sub OpenSingleViewFromBagMenu_Click()
On Error GoTo Err_OpenSingleViewFromBagMenu_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Single View"
stLinkCriteria = "[Case ID]=" & Me![CaseID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Not IsNull(Me.CaseID) Then
stLinkCriteria = "[Case ID]=" & Me![Case ID]
MsgBox “You left the Search fieled empty!
End If
Exit_OpenSingleViewFromFBMenu_Click:
Exit Sub
Err_OpenSingleViewFromFBMenu_Click:
MsgBox Err.Description
Resume Exit_OpenSingleViewFromFBMenu_Click
End Sub
Thanks!
Below code returns Error highlighted DoCmd.OpenForm stDocName, , ,
stLinkCriteria and the MsgBox does not “fire†if [CaseID] is left empty…
Private Sub OpenSingleViewFromBagMenu_Click()
On Error GoTo Err_OpenSingleViewFromBagMenu_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Single View"
stLinkCriteria = "[Case ID]=" & Me![CaseID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
If Not IsNull(Me.CaseID) Then
stLinkCriteria = "[Case ID]=" & Me![Case ID]
MsgBox “You left the Search fieled empty!
End If
Exit_OpenSingleViewFromFBMenu_Click:
Exit Sub
Err_OpenSingleViewFromFBMenu_Click:
MsgBox Err.Description
Resume Exit_OpenSingleViewFromFBMenu_Click
End Sub
Thanks!