Hey George,
I used this recently in a similar situation - I've made a few edits
and comments to suit what your situation sounds like. The idea is not
to test and msgbox in the query, but _before_ the query even runs -
why bother collecting records if you know there aren't any?!
This should work in the ON_CHANGE function for the control you set the
MAN NO in, if you can't find a better place for it.
Of course, before you even read it, I'm sure you know the drill: if
this code doesn't work, crashes MSAccess, or causes aliens to abduct
you for a series of somewhat uncomfortable examinations, don't be
complaining at me!
DO let me know if I can explain anything better tho...
Replace all the code below IN_CAPS with your own controls, tables and
fields respectively...
Dim db As Database
Dim rst As Recordset
'Make sure there's a value in the field that identifies the MAN NO
If Not (IsNull(TXT_MANNO)) Then
'Populate the recordset with the tool issue data to test
Set db = CurrentDb
Set rst = db.OpenRecordset("TBL_TOOLISSUES", dbOpenDynaset)
'Test the recordset for any issues to this MAN NO
rst.FindFirst "FLD_MANNO = " & TXT_MANNO
If rst.NoMatch Then
MsgBox "No Matching Records Found"
End If
rst.Close
Set rst = Nothing
Set db = Nothing
End If
HTH - Matt