PMFJI,
What exactly are you trying to do?
If a book ID is in the result set of the query (combo row source), why are you trying to use Dlookup()??
Is "tblBooks" a table of all books and "tblLibrary" a table of books available to loan?
Might be easier:
Code:
Private Sub BookName_ID_AfterUpdate()
Dim r As DAO.Recordset
Dim sSQL As String
'ID is a number type
sSQL = "Select ID FROM tblLibrary WHERE ID = " & Me.BookName_ID
Set r = CurrentDb.OpenRecordset(sSQL)
If r.BOF And r.EOF Then
msgbox "Book not available"
' Else
' msgbox "Book is available"
End If
'clean up
r.Close
Set r = Nothing
End Sub