I have form with sub form. There is a combo on form which filter records of many orders in sub form.
Now the problem is if I put an order name in combo which is not exist and press enter it also show me record of first order.
I want that if I enter an order which not exist in Record then it should give me a message that " This order not exist.
here is my code in after update event of combo.
Private Sub CBOBATCH_AfterUpdate()
'Find the that matches the control
Dim rs As Object
Set rs = Me.Recordset.Clone
'check if there is a batch number
If Len(Trim(Me.CBOBATCH)) > 0 Then
rs.FindFirst "[batchno]='" & Me![CBOBATCH] & "'"
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
DoCmd.GoToRecord , , acNewRec