Robert L. Stewart
rl_stewart at highstream.net
Thu Oct 2 12:55:09 CDT 2003
Tony, You need to be careful of using recordcount. It is better to do this: if rs.eof and rs.bof then The only time both are true is if the recordset is empty. Robert At 12:00 PM 10/2/2003 -0500, you wrote: >Date: Wed, 24 Sep 2003 00:55:26 -0700 >From: Tony Septav <iggy at nanaimo.ark.com> >Subject: [AccessD] CBO Not in List >To: accessd at databaseadvisors.com >Message-ID: <3F714DED.907D33D2 at nanaimo.ark.com> >Content-Type: text/plain; charset=us-ascii > >Hey All >Hope this is of some help. > >If you use the On Change event of the combo box you can check to see if >the info typed in exists >. > >Simple example > >Dim Db as database >Dim Rst as recordset >Dim Sql as string > >sql="select store from company where store=""" & me!mycombo.text & "*" >& """;" > >set db=currentdb() >set rst=db.openrecordset(sql,dbopendynaset) > >if rst.recordcount=0 then > docmd.beep >endif > >rst.close