Access 2002

  • Thread starter Thread starter barbapapa
  • Start date Start date
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.
 
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.
 
Back
Top