tags:

views:

30

answers:

2

I'm attempting to declare DAO variables in VB, but when I go to assignment statements, it says they must be declared. But I've just declared them in the line above! What's going on?

Code:

 Public Class frmBaseForm

     Public acDb As dao.Database
     Public acRs As dao.Recordset

     acRs = acDb.OpenRecordset("Something")

 End Class

acRs shows up as undeclared in the last line.

A: 

You must first add the Dao object library in your project(that's just in case you haven't done so yet).

Erethon
+1  A: 
Public Class frmBaseForm

    Public acDb As dao.Database
    Public acRs As dao.Recordset

   Public Sub ArbitraryEvent()
    acDB = New dao.Database
    acRs = acDb.OpenRecordset("Something")
   End Sub
End Class

Or something like that

rockinthesixstring
Thanks, I'll try it.
deadwanderer