Global UpdatingRecords As Boolean
===================================
UpdatingRecords = False
========================================
On Error Resume Next
=============================================
 
UpdatingRecords = False

Text2.Enabled = False

On Error GoTo err1
Data1.Recordset.Update
Exit Sub

err1:
msg = MsgBox("    ", vbInformation + vbOKOnly, "C???EEE")
=========================================
  
Dim BookFound As Boolean
BookFound = False

Data1.Recordset.MOVEFIRST
Text3.Text = Text7.Text & " " & Text8.Text & " " & Text9.Text & " " & Text10.Text

While Not Data1.Recordset.EOF
If Option1 = True Then
With Data1.Recordset
    If (.Fields(6) & " " & .Fields(7) & " " & .Fields(8) & " " & .Fields(9)) = Text2.Text Then
    BookFound = True
    Exit Sub
    End If
End With

ElseIf Option2 = True Then
    If Data1.Recordset.Fields(2) = Text2.Text Then
    BookFound = True
        Exit Sub
    End If

Else
msg = MsgBox("   ", vbInformation + vbOKOnly, "")
Exit Sub
End If
Data1.Recordset.MOVENEXT
Text3.Text = Text7.Text & " " & Text8.Text & " " & Text9.Text & " " & Text10.Text

Wend
   If Not BookFound Then
    msg = MsgBox("    ", vbInformation + vbOKOnly, "")
    End If
===============================================
  
Dim BookFound As Boolean

BookFound = False

Data1.Recordset.MOVEFIRST
While Not Data1.Recordset.EOF
If Option1 = True Then
    If Data1.Recordset.Fields(0) = Val(Text4.Text) Then
    BookFound = True
        Exit Sub
    End If
ElseIf Option2 = True Then
    If Data1.Recordset.Fields(1) = Text4.Text Then
    BookFound = True
        Exit Sub
    End If

ElseIf Option3 = True Then
    If Data1.Recordset.Fields(11) = Val(Text4.Text) Then
    BookFound = True

        Exit Sub
    End If

ElseIf Option4 = True Then
    If Data1.Recordset.Fields(2) = Text4.Text Then
    BookFound = True

        Exit Sub
    End If
Else
msg = MsgBox("   ", vbInformation + vbOKOnly, "")
Exit Sub
End If
Data1.Recordset.MOVENEXT
Wend
   If Not BookFound Then
    msg = MsgBox("    ", vbInformation + vbOKOnly, "")
    End If
=================================
 
Private Sub Text2_KeyPress(KeyAscii As Integer)
Dim BookFound As Boolean
BookFound = False


If KeyAscii = 13 Then

    Data1.Recordset.MOVEFIRST

While Not Data1.Recordset.EOF
    
 If Text2.Text <> "" Then

     If (Data1.Recordset.Fields(0)) = Val(Text2.Text) Then
        Text2.Text = Data1.Recordset.Fields(0)
        Text3.Text = Data1.Recordset.Fields(1)
        BookFound = True
        Exit Sub
     End If
 Else
    msg = MsgBox("   ", vbInformation + vbOKOnly, "")
    Exit Sub
 End If
    Data1.Recordset.MOVENEXT
    Text2.Text = Data1.Recordset.Fields(0)
    Text3.Text = Data1.Recordset.Fields(1)
    
Wend
       If Not BookFound Then
          Data1.Recordset.MOVEFIRST
          msg = MsgBox("    ", vbInformation + vbOKOnly, "")
       End If
        
End If
    
*********************************
End Sub

Private Sub Text3_KeyPress(KeyAscii As Integer)
Dim BookFound As Boolean
BookFound = False


If KeyAscii = 13 Then

    Data1.Recordset.MOVEFIRST

While Not Data1.Recordset.EOF
    
 If Text3.Text <> "" Then

     If (Data1.Recordset.Fields(0)) = Val(Text2.Text) Then
        Text2.Text = Data1.Recordset.Fields(0)
        Text3.Text = Data1.Recordset.Fields(1)
        BookFound = True
        Exit Sub
     End If
 Else
    msg = MsgBox("   ", vbInformation + vbOKOnly, "")
    Exit Sub
 End If
    Data1.Recordset.MOVENEXT
    Text2.Text = Data1.Recordset.Fields(0)
    Text3.Text = Data1.Recordset.Fields(1)
    
Wend
       If Not BookFound Then
          Data1.Recordset.MOVEFIRST
          msg = MsgBox("    ", vbInformation + vbOKOnly, "")
       End If
        
End If
End Sub
