Please bear with me, the length of the code is long. I'm trying to get this search form search again after the first search is completed. I can type in a barcode # and perform a search but when I try another search, I get a yellow highlight pointing to the following code:
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
I get this whether I completely enter a new number or if I just overwrite part of the number. He is the code. Any help is appreciated.
Private Sub Command4_Click()
stringChk = Text00.Value
If Me.Text00.Value = "0" Then
GoTo EndSeq
End If
Me.Text01.Value = Null
Me.Text02.Value = Null
Me.Text03.Value = Null
Me.Text04.Value = Null
Me.Text05.Value = Null
Me.Text06.Value = Null
Me.Text07.Value = Null
Me.Text08.Value = Null
Me.Text09.Value = Null
Me.Text10.Value = Null
Me.Text11.Value = Null
Me.Text12.Value = Null
Me.Text13.Value = Null
Me.Check01.Value = False
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "Barcode = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo TapeDescriptionChk
End If
GoTo Tape_DC
TapeDescriptionChk:
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "TapeDescription = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo BackupDateChk
End If
GoTo Tape_DC
BackupDateChk:
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "BackupDate = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo SeqNumberofTapesChk
End If
GoTo Tape_DC
SeqNumberofTapesChk:
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "SeqNumberofTapes = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo JobIDChk
End If
GoTo Tape_DC
JobIDChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "JobID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo SerialNumberChk
End If
GoTo Tape_DC
SerialNumberChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "SerialNumber = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo TapeCategoryChk
End If
TapeCategoryChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "TapeCategoryID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo BackupLocationChk
End If
BackupLocationChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "BackupLocationID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo EmployeeChk
End If
EmployeeChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "EmployeeID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo RelocationDateChk
End If
RelocationDateChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "RelocationDate = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo RelocationSiteChk
End If
RelocationSiteChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "RelocationSiteID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo CurrentTapeLocationChk
End If
CurrentTapeLocationChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "CurrentTapeLocation = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo CommentsChk
End If
CommentsChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "Comments = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo InComingTapeChk
End If
InComingTapeChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "IncomingTape = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo PendingFill
End If
PendingFill:
Me.Text01.Value = myrec!BarCode.Value
Me.Text02.Value = myrec!TapeDescription.Value
Me.Text03.Value = myrec!BackupDate.Value
Me.Text04.Value = myrec!SeqNumberofTapes.Value
Me.Text05.Value = myrec!JobID.Value
Me.Text06.Value = myrec!SerialNumber.Value
Me.Text07.Value = myrec!TapeCategoryID.Value
Me.Text08.Value = myrec!BackupLocationID.Value
Me.Text09.Value = myrec!EmployeeID.Value
Me.Text10.Value = myrec!RelocationDate.Value
Me.Text11.Value = myrec!RelocationSiteID.Value
Me.Text12.Value = myrec!CurrentTapeLocation.Value
Me.Text13.Value = myrec!Comments.Value
Me.Check01.Value = myrec!IncomingTape.Value
Me.Text01.Value = Null
Me.Text02.Value = Null
Me.Text03.Value = Null
Me.Text04.Value = Null
Me.Text05.Value = Null
Me.Text06.Value = Null
Me.Text07.Value = Null
Me.Text08.Value = Null
Me.Text09.Value = Null
Me.Text10.Value = Null
Me.Text11.Value = Null
Me.Text12.Value = Null
Me.Text13.Value = Null
Me.Check01.Value = False
GoTo EndSeq
Tape_DC:
Me.Text01.Value = myrec!BarCode.Value
Me.Text02.Value = myrec!TapeDescription.Value
Me.Text03.Value = myrec!BackupDate.Value
Me.Text04.Value = myrec!SeqNumberofTapes.Value
Me.Text05.Value = myrec!JobID.Value
Me.Text06.Value = myrec!SerialNumber.Value
Me.Text07.Value = myrec!TapeCategoryID.Value
Me.Text08.Value = myrec!BackupLocationID.Value
Me.Text09.Value = myrec!EmployeeID.Value
Me.Text10.Value = myrec!RelocationDate.Value
Me.Text11.Value = myrec!RelocationSiteID.Value
Me.Text12.Value = myrec!CurrentTapeLocation.Value
Me.Text13.Value = myrec!Comments.Value
Me.Check01.Value = myrec!IncomingTape.Value
EndSeq:
End Sub
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
I get this whether I completely enter a new number or if I just overwrite part of the number. He is the code. Any help is appreciated.
Private Sub Command4_Click()
stringChk = Text00.Value
If Me.Text00.Value = "0" Then
GoTo EndSeq
End If
Me.Text01.Value = Null
Me.Text02.Value = Null
Me.Text03.Value = Null
Me.Text04.Value = Null
Me.Text05.Value = Null
Me.Text06.Value = Null
Me.Text07.Value = Null
Me.Text08.Value = Null
Me.Text09.Value = Null
Me.Text10.Value = Null
Me.Text11.Value = Null
Me.Text12.Value = Null
Me.Text13.Value = Null
Me.Check01.Value = False
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "Barcode = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo TapeDescriptionChk
End If
GoTo Tape_DC
TapeDescriptionChk:
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "TapeDescription = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo BackupDateChk
End If
GoTo Tape_DC
BackupDateChk:
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "BackupDate = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo SeqNumberofTapesChk
End If
GoTo Tape_DC
SeqNumberofTapesChk:
stringQry = "Select * from [Tape DC] where "
stringQry = stringQry & "SeqNumberofTapes = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo JobIDChk
End If
GoTo Tape_DC
JobIDChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "JobID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo SerialNumberChk
End If
GoTo Tape_DC
SerialNumberChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "SerialNumber = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo TapeCategoryChk
End If
TapeCategoryChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "TapeCategoryID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo BackupLocationChk
End If
BackupLocationChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "BackupLocationID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo EmployeeChk
End If
EmployeeChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "EmployeeID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo RelocationDateChk
End If
RelocationDateChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "RelocationDate = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo RelocationSiteChk
End If
RelocationSiteChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "RelocationSiteID = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo CurrentTapeLocationChk
End If
CurrentTapeLocationChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "CurrentTapeLocation = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo CommentsChk
End If
CommentsChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "Comments = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo InComingTapeChk
End If
InComingTapeChk:
stringQry = "Select * from [Tape_DC] where "
stringQry = stringQry & "IncomingTape = " & cquot & stringChk & cquot
myrec.Open stringQry, CurrentProject.Connection, , adLockOptimistic
If myrec.EOF Then
myrec.Close
GoTo PendingFill
End If
PendingFill:
Me.Text01.Value = myrec!BarCode.Value
Me.Text02.Value = myrec!TapeDescription.Value
Me.Text03.Value = myrec!BackupDate.Value
Me.Text04.Value = myrec!SeqNumberofTapes.Value
Me.Text05.Value = myrec!JobID.Value
Me.Text06.Value = myrec!SerialNumber.Value
Me.Text07.Value = myrec!TapeCategoryID.Value
Me.Text08.Value = myrec!BackupLocationID.Value
Me.Text09.Value = myrec!EmployeeID.Value
Me.Text10.Value = myrec!RelocationDate.Value
Me.Text11.Value = myrec!RelocationSiteID.Value
Me.Text12.Value = myrec!CurrentTapeLocation.Value
Me.Text13.Value = myrec!Comments.Value
Me.Check01.Value = myrec!IncomingTape.Value
Me.Text01.Value = Null
Me.Text02.Value = Null
Me.Text03.Value = Null
Me.Text04.Value = Null
Me.Text05.Value = Null
Me.Text06.Value = Null
Me.Text07.Value = Null
Me.Text08.Value = Null
Me.Text09.Value = Null
Me.Text10.Value = Null
Me.Text11.Value = Null
Me.Text12.Value = Null
Me.Text13.Value = Null
Me.Check01.Value = False
GoTo EndSeq
Tape_DC:
Me.Text01.Value = myrec!BarCode.Value
Me.Text02.Value = myrec!TapeDescription.Value
Me.Text03.Value = myrec!BackupDate.Value
Me.Text04.Value = myrec!SeqNumberofTapes.Value
Me.Text05.Value = myrec!JobID.Value
Me.Text06.Value = myrec!SerialNumber.Value
Me.Text07.Value = myrec!TapeCategoryID.Value
Me.Text08.Value = myrec!BackupLocationID.Value
Me.Text09.Value = myrec!EmployeeID.Value
Me.Text10.Value = myrec!RelocationDate.Value
Me.Text11.Value = myrec!RelocationSiteID.Value
Me.Text12.Value = myrec!CurrentTapeLocation.Value
Me.Text13.Value = myrec!Comments.Value
Me.Check01.Value = myrec!IncomingTape.Value
EndSeq:
End Sub