Access 2002

B

barbapapa

I get this error message"compile error: Invalid outside procedure" regarding
the SET DB = CURRENTDB() in access 2002 that I never got in access 97 when I
type:

Dim db As Databases
Dim rec As Recordset
Dim var1 As String

Set db = CurrentDb()
Set rec = db.OpenRecordset("e-mail")

var1 = rec(0)

Thanks.
 
J

John Vinson

I get this error message"compile error: Invalid outside procedure" regarding
the SET DB = CURRENTDB() in access 2002 that I never got in access 97 when I
type:

Dim db As Databases
Dim rec As Recordset
Dim var1 As String

Set db = CurrentDb()
Set rec = db.OpenRecordset("e-mail")

var1 = rec(0)

This doesn't work for me in A97 either - it IS "invalid outside
procedure". Check your A97 code; I'm all but certain that it would
have a line

Private Sub <some event>

before the first Dim.
 

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


Top