Knowledge Base Help Not working

B

Brad

Thanks for taking the time to read my quesiton.

http://support.microsoft.com/default.aspx?scid=kb;en-us;210290 is not
working for me.

I have my Row Source Type set to Table/Query, then I set my Row Source using
Query Builder (...), then I change my Row Source Type to AddAllToList. I put
1;2;<None> in the Tag line of the combo box.

Nothing happens. What else am I missing?

Then I make a function called Test that simply calls the copied function
AddAllToList and then I get an error saying that the following line has a
user-defined type not defined

Static DB As Database, RS As Recordset

I believe it is referring to "Database".

Does this code really work?

thanks again for your help,

Brad
 
K

Ken Snell [MVP]

Chances are that you're using 2000 or 2002 version of ACCESS. These versions
do not have a reference to the DAO library set automatically (Database is in
the DAO library). Open VBE, click on Tools | References, and select the Data
Access Objects library (v3.x). Then disambiguate the VBA code this way
(needed because Recordset is an object in both the DAO and ADO libraries):

Static DB As DAO.Database, RS As DAO.Recordset
 
D

Douglas J. Steele

You must be using either Access 2000 or Access 2002.

Database is a DAO object. By default, both Access 2000 and 2002 use ADO.

With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it. If you're not going to be
using ADO, uncheck the reference to Microsoft ActiveX Data Objects 2.1
Library

If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
Dim rsCurr As ADODB.Recordset)

The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset
 
Top