Where do you find the Table and Query objects in the Object Browser classes?

P

Paul James

I'm trying to find the Table and Query objects in the Object Browser, but
thus far I haven't been successful.

I looked under all items in the Project Library, but neither Table, Tables,
Query or Queries show up in the Classes window. Tabledef and Querydef are
there, but these aren't the Table and Query objects I'm looking for.

Can anyone tell me where I can find the Table and Query objects in the
Object Browser?

As a secondary question, in reading about the Object Browser, I got the
impression that you could use it to browse through all available objects and
see their properties, methods and events. So I would have expected to be
able to select any Access object in the Classes window, and find its
properties, methods and events in the "Members of" window to the right;
especially objects such as tables and queries that are so fundamental to a
database. But if tables and queries aren't displayed in the Classes window,
evidently it's not as simple or straightforward as I hoped it would be.

I notice that some Access objects such as Form, Forms, DoCmd and ComboBox
are available in the Classes window, but others, such as the tables and
queries that I'm currently looking for, are not. What determines whether an
object can be located in the Classes window, and for those that aren't, how
can you know where to look for them?

Thanks in advance.

Paul
 
G

Graham Mandeno

Hi Paul

The OB window is for browsing the *object models* of those libraries which
are referenced by the current project. It's not intended for browsing the
actual objects in the current database.

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 
P

Paul James

Thanks, Graham.

I'm surprised that you can't use the Object Browser for browsing the actual
objects in the current database, because those are the objects I'd like to
be able to control with VBA code. It would seem that obtaining information
about the object models of the referenced libraries wouldn't be as important
as obtaining information about the objects in the database itself.

I was hoping I could use the Object Browser to browse through the objects in
my database and get information about their properties and methods so I
could control those objects in VBA. Could you recommend any sources that
would give me that kind of information?

Thanks


Graham Mandeno said:
Hi Paul

The OB window is for browsing the *object models* of those libraries which
are referenced by the current project. It's >
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.

Paul James said:
I'm trying to find the Table and Query objects in the Object Browser, but
thus far I haven't been successful.

I looked under all items in the Project Library, but neither Table, Tables,
Query or Queries show up in the Classes window. Tabledef and Querydef are
there, but these aren't the Table and Query objects I'm looking for.

Can anyone tell me where I can find the Table and Query objects in the
Object Browser?

As a secondary question, in reading about the Object Browser, I got the
impression that you could use it to browse through all available objects and
see their properties, methods and events. So I would have expected to be
able to select any Access object in the Classes window, and find its
properties, methods and events in the "Members of" window to the right;
especially objects such as tables and queries that are so fundamental to a
database. But if tables and queries aren't displayed in the Classes window,
evidently it's not as simple or straightforward as I hoped it would be.

I notice that some Access objects such as Form, Forms, DoCmd and ComboBox
are available in the Classes window, but others, such as the tables and
queries that I'm currently looking for, are not. What determines
whether
an
object can be located in the Classes window, and for those that aren't, how
can you know where to look for them?

Thanks in advance.

Paul
 
T

TC

Your mistake is in assuming what names will be used in the object browser.
You *assume* that the tables will be called Tables (or somesuch), and the
queries will be called Querys (or somesuch). But that is simply not true. In
DAO, tables are exposed through the TableDefs collection, which contains
TableDef objects. If you look for a Table object, you will not find one, cos
that's not how it happens!

HTH,
TC
 
J

Joe Fallon

In 2002, there are some nice collections that can be accessed from
CurrentProject and CurrentData.
CurrentData includes: AllQueries, AllTables
CurrentProject includes: AllForms, AllReports, AllMacros, AllModules,
AllDataAccessPages

Here is how to list all tables:

Public Sub ListTables()
Dim obj As AccessObject
With CurrentData
For Each obj in .AllTables
Debug.Print " " & obj.Name
Next obj
End With
End Sub

Public Sub ListModules()
Dim obj As AccessObject
With CurrentProject
For Each obj In .AllModules
On Error Resume Next
Debug.Print " " & obj.Name
Next obj
End With
End Sub

--
Joe Fallon
Access MVP



Paul James said:
Thanks, Graham.

I'm surprised that you can't use the Object Browser for browsing the actual
objects in the current database, because those are the objects I'd like to
be able to control with VBA code. It would seem that obtaining information
about the object models of the referenced libraries wouldn't be as important
as obtaining information about the objects in the database itself.

I was hoping I could use the Object Browser to browse through the objects in
my database and get information about their properties and methods so I
could control those objects in VBA. Could you recommend any sources that
would give me that kind of information?

Thanks


Graham Mandeno said:
Hi Paul

The OB window is for browsing the *object models* of those libraries which
are referenced by the current project. It's >
--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.

Paul James said:
I'm trying to find the Table and Query objects in the Object Browser, but
thus far I haven't been successful.

I looked under all items in the Project Library, but neither Table, Tables,
Query or Queries show up in the Classes window. Tabledef and Querydef are
there, but these aren't the Table and Query objects I'm looking for.

Can anyone tell me where I can find the Table and Query objects in the
Object Browser?

As a secondary question, in reading about the Object Browser, I got the
impression that you could use it to browse through all available
objects
and
see their properties, methods and events. So I would have expected to be
able to select any Access object in the Classes window, and find its
properties, methods and events in the "Members of" window to the right;
especially objects such as tables and queries that are so fundamental
to
a whether aren't,
how
 
G

Geoff

Nice tip, Joe.

I didn't know about these collections - only about
containers.

(BTW - I checked in 2000 and these collections are
present in 2000 too, as you probably already know.)

Geoff
 

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