How do i convert "Dim mytable As Table" in access 2000?

R

Rey

I am trying to convert an Access 97 to Access 2000 but it does not like the
above statement. The program later sets "mytable" to an open table in the
database with

Set MyTable = mydb.OpenTable("MthAvgTbl")

Any ideas would be great.
Thanks
 
6

'69 Camaro

Hi, Rey.

Set a Reference to the DAO library (if it isn't already one of the
References) and try:

Dim myTable As TableDef


HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are [email protected] and [email protected]

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
R

Rey

How do i do that? I did the "Dim myTable as TableDef" but then
"Set MyTable = mydb.OpenTable("MthAvgTbl")" doesn't work.

Thanks '69 Camaro
 
6

'69 Camaro

Hi, Rey.
How do i do that?

Open the VB Editor and select the Tools menu -> References... to open the
References dialog window. Browse to the Microsoft DAO 3.6 Object Library and
check the box, then close the dialog window.
"Set MyTable = mydb.OpenTable("MthAvgTbl")" doesn't work.

Sorry. I didn't look very closely at your other code. OpenTable( ) is a
method of the DoCmd class, not a (presumably) database object. What exactly
are you trying to do? Open up a table for viewing or programmatically run
through the records? If you want to run through the records, you'll need to
open a Recordset instead.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)
Beware to those who use munged addresses: known newsgroup E-mail harvesters
for spammers are [email protected] and [email protected]

- - -
When you see correct answers to your question posted in Microsoft's Online
Community, please sign in to the Community and mark these posts as "Answers,"
so that all may benefit by filtering on "Answered questions" and quickly
finding the right answers to similar questions. Remember that questions
answered the quickest are often from those who have a history of rewarding
the contributors who have taken the time to answer questions correctly.
 
B

Brendan Reynolds

That's obsolete DAO 2.x (Access 2) syntax that is no longer supported. For
Access 97, there was a DAO 2.x/3.x Compatibility Library that enabled the
obsolete code to continue to work in Access 97, but there's no DAO 2.x/3.6
Compatibility Library (DAO 3.6 being the version of DAO used in Access 2000
and later). You need to edit the obsolete code to use OpenRecordset instead
of OpenTable.
 
Top