Return reference to current database?

  • Thread starter Thread starter Leonard
  • Start date Start date
L

Leonard

This code worked fine in Access 2000 but doesn't seem to
work in Access 2002. Is this correct? If so what is my
alternative.

Any and all help apprciated.

' Return reference to current database.
'
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("MyQuery")

If rst.RecordCount >= 1 Then
Blah...Blah...Blah
Else
Blah...Blah...Blah
End If
 
From any code window, choose References on the Tools menu.

Check the box beside:
Microsoft DAO 3.6
 
Thanks Allen

-----Original Message-----
From any code window, choose References on the Tools menu.

Check the box beside:
Microsoft DAO 3.6

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.



.
 
Back
Top