Return reference to current database?

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
 
A

Allen Browne

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

Check the box beside:
Microsoft DAO 3.6
 
L

Leonard

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.



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

File in use error 5
Type Mismatch 3
Too few parameters 13
Message from Access 2007 on sub function 3
Requery problem 2
making recordset allow edits 5
Type mismatch error 2
Test for records based on query 3

Top