List of tables and fields

D

Dorci

Long ago, I found a cool solution for listing tables and fields. It creates
a TABLE of tables and fields, that can be sorted and printed. It consists of
a table called tsysFields, a module called basReportTools, and a report
called rptTablesAndFields.

HOWEVER, I can't seem to make it work. I copied everything from the MDB in
which it does work, but when I run the report (which runs the module and
populates the table), I get the following compile error: "Method or data
member not found", which refers to "fld.OrdinalPosition" in the code. Any
advice?

Thanks in advance,
Dorci
 
R

RoyVidar

Dorci said:
Long ago, I found a cool solution for listing tables and fields. It
creates a TABLE of tables and fields, that can be sorted and
printed. It consists of a table called tsysFields, a module called
basReportTools, and a report called rptTablesAndFields.

HOWEVER, I can't seem to make it work. I copied everything from the
MDB in which it does work, but when I run the report (which runs the
module and populates the table), I get the following compile error:
"Method or data member not found", which refers to
"fld.OrdinalPosition" in the code. Any advice?

Thanks in advance,
Dorci

I think the system relies on the order of references (which I think
is pretty dangerous). Somewhere, you will have a declaration like

dim fld as field

change that to

dim fld as dao.field

Likewise, everywhere you find unqualified declaretions of DAO objects,
you should qualify them with prefixing with DAO (recordset, database,
querydef, tabledef...)

There's also the possibility that you don't have the DAO library
referenced (tools | references - Microsoft DAO 3.# Object Library)
 
T

Tom Wickerath

To add a little bit to Roy's answer, here is a document that I wrote on the
subject:

ADO and DAO Library References in Access Databases
http://www.access.qbuilt.com/html/ado_and_dao.html

You might be interested in downloading and installing a free add-in that
will help you generate this type of documentation:

CSD Tools
http://home.bendbroadband.com/conradsystems/accessjunkie/csdtools.html

This way, you won't need to import the module and report into every database
that you wish to document.


Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 
D

Dorci

The DAO library was already referenced, so I tried "dim fld as dao.field" and
that got me past that error, but a different error occured. Then I got Tom's
response and that fixed the next problem. As always, thanks for your
valuable help!
 
D

Dorci

In a bit of a hurry, I skimmed the link you provided and noticed it mentioned
the PRIORITY of reference libraries. So I reordered my libraries to match my
other database, and voila! Problem solved. I'll definitely check out the
link and the documentation tool you suggested more thoroughly a bit later.
Thanks so much for your help!
 
D

Douglas J. Steele

In the long run, you're far better off disambiguating your declarations by
using Dim fld As DAO.Field, or Dim fld As ADODB.Field, or whatever.
 

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

Top