I don't understand what you mean by linking the subform to the unbound
textbox. Where did you make that link?
What I suggest is to use the same query (LogoutQry2) in conjunction with the
textbox value to open a recordset object and check the RecordCount property
of the recordset. You would do this in the AfterUpdate event of the textbox.
Am I correct in guessing that the textbox value is to be used in a WHERE
clause added to the query? Create a QueryDef object based on the query and
use that to fetch its SQL code, then add the textbox value to the SQL code
as a WHERE clause. Something like this:
Dim qry As DAO.QueryDef
Dim strSQL As String
Dim rs as DAO.Recordset
Set qry = CurrentDb.CreateQueryDef("LogoutQry2", strSQL)
strSQL = qry.SQL
' Add your textbox value here
strSQL = strSQL & " WHERE [some field in the query]='" & textbox & "'"
Set rs = CurrentDb.OpenRecordset(strSQL)
rs.MoveLast
rs.MoveFirst
If rs.RecordCount = 0 Then...
Of course, this assumes you're using DAO; I'm sure you can do something
similar with ADO but I'm not familiar with the syntax. This is also just
"air code", you'd have to flesh it out to make it work.
Carl Rapson