Call my HasRecords function this way
strsql holding the table or query you want to test, and istruefalsefieldname
being the name of the field you want to test for a true value
Rodrigo.
sub Test()
dim strSql as str
strSql = " SELECT tmpTable.* FROM tmpTableWHERE ( IsTrueFalseFieldName =
True ) ; "
if not hasrecords(strsql) then
msgbox "No True value found"
end if
end sub
Public Function HasRecords(Tbl_or_SQL_Source As String) As Boolean
On Error Resume Next
dim db as dao.database
dim rs as dao.recordset
Set db = DBEngine(0)(0)
Set rs = db.OpenRecordset(Tbl_or_SQL_Source, dbOpenDynaset, dbReadOnly)
HasRecords = Not (rs.EOF And rs.BOF)
Set rs = Nothing
Set db = Nothing
End Function