If rs.NoMatch or Not rs.EOF

  • Thread starter Thread starter Derek Brown
  • Start date Start date
D

Derek Brown

Hi all

Can anyone explain the diferance between

If rs.NoMatch, and
If Not rs.EOF

The latter being the one that is automatically produced by access when using
the wizard to produce a record finding combo box. I can see the differance
but why does MSoft use something different? I do get problems when a record
in a combo has previuosly been deleted, so that if accidently selecting that
record I get an error does NoMatch cover this?

Thanks to Allen Browne for pointing this out. I have been doing this wrong
for 10 years!!
 
Derek Brown said:
Hi all

Can anyone explain the diferance between

If rs.NoMatch, and
If Not rs.EOF

The latter being the one that is automatically produced by access
when using the wizard to produce a record finding combo box. I can
see the differance but why does MSoft use something different? I do
get problems when a record in a combo has previuosly been deleted, so
that if accidently selecting that record I get an error does NoMatch
cover this?

Thanks to Allen Browne for pointing this out. I have been doing this
wrong for 10 years!!

Microsoft's wizard code is *wrong*, in that it only works if a find is
being done in an ADO recordset, which would only be the case if you're
working in an ADP, not in MDBs which constitute the vast majority of
Access database applications.

If your code is running in an MDB file, then you should be testing
rs.NoMatch to see if a matching record was found or not.
 
Thanks Dirk

Dirk Goldgar said:
Microsoft's wizard code is *wrong*, in that it only works if a find is
being done in an ADO recordset, which would only be the case if you're
working in an ADP, not in MDBs which constitute the vast majority of
Access database applications.

If your code is running in an MDB file, then you should be testing
rs.NoMatch to see if a matching record was found or not.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top