Choosing a value from a recordset using MS-Access VBA -
Choosing a value from a recordset using MS-Access VBA -
i'd create search textbox names. i'm using dao record set records name entered. when returning more 1 record, i'd show user results , have him take name (record) list.
dim dbs dao.database dim rs dao.recordset dim strsql string dim sql string set dbs = currentdb() dim diverfirstname string diverfirstname = cstr(me.txtsearchfirst) + "*" strsql = " select tbldiver.* " & _ " tbldiver " & _ " tbldiver.firstname '" & diverfirstname & "' ;" set rs = dbs.openrecordset(strsql, dbopendynaset) rs.movelast if rs.recordcount > 1 *** code display table returned records user can take here *** exit sub how should approach this?
you cycle through recordset results with:
rs.movefirst until rs.eof 'add listbox or me.listbox1.additem rs.fields("firstname").value & " " & rs.fields("lastname").value rs.movenext loop vba ms-access dao recordset
Comments
Post a Comment