theinviter
Registered User.
- Local time
- Yesterday, 19:33
- Joined
- Aug 14, 2014
- Messages
- 240
Dears;
I have a list in the form and upon double click open another form and filter to selected record,
i need if NO record , do not open the form and proceed to next .
i tried this code below but it show the message and open the form .
Private Sub List6_DblClick(Cancel As Integer)
On Error GoTo errhandler:
n = 1 / 0 ' cause an error
'Move to the record selected in the control
With Me.MRN_Query1_subform.Form.RecordsetClone
.FindFirst "[Item Code] = '" & Me.List6.value & "'"
If .NoMatch Then
MsgBox "No Record Found!"
DoCmd.OpenForm "MRN_Query1_Delivered", acNormal, , " [Item Code] = '" & Me.List6 & "' and [Location - Clinics Code] = " & Me.MRN_Query1_subform.Form![Location_Code]
Else
Me.MRN_Query1_subform.Form.Bookmark = .Bookmark
End If
End With
Exit Sub
errhandler:
' error handling code
Resume Next
so what to do .
I have a list in the form and upon double click open another form and filter to selected record,
i need if NO record , do not open the form and proceed to next .
i tried this code below but it show the message and open the form .
Private Sub List6_DblClick(Cancel As Integer)
On Error GoTo errhandler:
n = 1 / 0 ' cause an error
'Move to the record selected in the control
With Me.MRN_Query1_subform.Form.RecordsetClone
.FindFirst "[Item Code] = '" & Me.List6.value & "'"
If .NoMatch Then
MsgBox "No Record Found!"
DoCmd.OpenForm "MRN_Query1_Delivered", acNormal, , " [Item Code] = '" & Me.List6 & "' and [Location - Clinics Code] = " & Me.MRN_Query1_subform.Form![Location_Code]
Else
Me.MRN_Query1_subform.Form.Bookmark = .Bookmark
End If
End With
Exit Sub
errhandler:
' error handling code
Resume Next
so what to do .