Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2005

Tip: Looking for answers? Try searching our database.

How do I define Database and Relation data types?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
R. Johnson - 31 Jan 2005 18:16 GMT
Using Access 2002 SP-2.

I want to join a native table to a table that is imported from a query in
another DB, so I started with the sample CreateRelation code in the Help
file.  The first line is

Dim dbs As Database, rel As Relation, fld As Field

I get an undefined data-type error for Database and Relation (but Field is
fine).  So, I was going to try a Type statement to create them.  But the Type
statement wants at least one "element" in the type, and all of the Help file
example data types' elements appear to be table-like fields.  I don't know
what elements to use in defining Database and Relation, or what data-types
the elements should be (I assume Object, but I don't know).

(This is new VBA turf for me.)
Brendan Reynolds - 31 Jan 2005 18:36 GMT
You need to add a reference (select References from the Tools menu in the
VBA editor) to the Microsoft DAO 3.6 Object Library.

If you also have a reference to the Microsoft ActiveX Object Library, be
careful to disambiguate when declaring variables of types that exist in both
libraries, for example Dim fld As DAO.Field or Dim fld As ADODB.Field. If
you don't disambiguate, VBA will default to using whichever library appears
first in the list of references.

Signature

Brendan Reynolds (MVP)

> Using Access 2002 SP-2.
>
[quoted text clipped - 14 lines]
>
> (This is new VBA turf for me.)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.