Hi there
Have been working for a while on this part of code. Basically beause of the way this clients database is written i have to do many workrounds.
This one is stumping me. The idea is simple. If the search text box is empty, the first message comes up. This works.
If the search text box has a number that is not in the system, by way of a query displayed on subform, the second message pops up, this works, however,as soon as i press OK, it displays the first message again. How can I stop it from displaying the first message after the second.
Have been working for a while on this part of code. Basically beause of the way this clients database is written i have to do many workrounds.
This one is stumping me. The idea is simple. If the search text box is empty, the first message comes up. This works.
If the search text box has a number that is not in the system, by way of a query displayed on subform, the second message pops up, this works, however,as soon as i press OK, it displays the first message again. How can I stop it from displaying the first message after the second.
Public Sub SearchCore()
On Error GoTo Err_nocore_Exit
Const conErrNotInList = 2427
If Search = "" Then
MsgBox "You did not enter a Core Number, Please Re-Enter!", vbOKOnly, "ERROR"
Search.SetFocus
Else
Forms!SearchCores![Search Core List].Requery
DoCmd.CancelEvent
If [Search Core List].Form![CopyCoreNo] = Null Then
Err_nocore_Exit:
If Err.Number = conErrNotInList Then
MsgBox "This core has either been broken, or does not exist in the database.", vbOKOnly, "CORE NOT FOUND"
Search = ""
Search.SetFocus
DoCmd.CancelEvent
'Else
Forms!SearchCores![Search Core List].Requery
End If
End If
End If
End Sub