first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Access to VB: Replacing DLOOKUP And Other Domain Lookup Functions with DAO Objects

' 'This code replaces the use of DLOOKUP and other 'domain lookup functions (e.g. DFIRST or DLAST) not 'available in VB. ' Dim strSQL As String, rsDAO As Recordset Dim varReturn

strSQL = "SELECT Subject FROM tblKBSubjects"

Set rsDAO = DBEngine(0)(0).OpenRecordset(strSQL)

rsDAO.FindFirst "Subject = 'Access 97'"

MsgBox rsDAO.Fields("Subject") ' 'The key is using the criteria argument 'in the FindFirst method. The methods 'of the Recordset object replace 'the domain lookup functions. '

mod date: 1999-01-12T06:19:51.000Z