Transfer of Coding from Access 97 to Access 2000 
Author Message
 Transfer of Coding from Access 97 to Access 2000

I have converted a database from Access 97 to Access 2000,
and everything works prefectly apart from the code.  I get
the message 'Compile error: User-defined type not
defined'.  I have looked at the types, which
are 'Database' and 'Table', i looked in the object browser
of VB in Access 2000 and they are not there, so now, the
code will not compile and run.  Is there something else i
can use instead of this?

Thanks



Sun, 05 Jun 2005 23:56:32 GMT  
 Transfer of Coding from Access 97 to Access 2000
Open any code module.  Select Tools|References.  Uncheck the ADO reference.
Check Microsoft DAO 3.6.  Access 2000 converts with ADO reference by
default.


Quote:
> I have converted a database from Access 97 to Access 2000,
> and everything works prefectly apart from the code.  I get
> the message 'Compile error: User-defined type not
> defined'.  I have looked at the types, which
> are 'Database' and 'Table', i looked in the object browser
> of VB in Access 2000 and they are not there, so now, the
> code will not compile and run.  Is there something else i
> can use instead of this?

> Thanks



Mon, 06 Jun 2005 00:02:33 GMT  
 Transfer of Coding from Access 97 to Access 2000
I just did this, and its not working, the compiler is now
moving onto the next type, which is 'Table', any ideas?
Quote:
>-----Original Message-----
>Open any code module.  Select Tools|References.  Uncheck
the ADO reference.
>Check Microsoft DAO 3.6.  Access 2000 converts with ADO
reference by
>default.



>> I have converted a database from Access 97 to Access
2000,
>> and everything works prefectly apart from the code.  I
get
>> the message 'Compile error: User-defined type not
>> defined'.  I have looked at the types, which
>> are 'Database' and 'Table', i looked in the object
browser
>> of VB in Access 2000 and they are not there, so now, the
>> code will not compile and run.  Is there something else
i
>> can use instead of this?

>> Thanks

>.



Mon, 06 Jun 2005 00:34:40 GMT  
 Transfer of Coding from Access 97 to Access 2000
There is no data type called Table.  Did this work before being converted
(doubtful).   Post your code.  It probably should be TableDef.


Quote:
> I just did this, and its not working, the compiler is now
> moving onto the next type, which is 'Table', any ideas?
> >-----Original Message-----
> >Open any code module.  Select Tools|References.  Uncheck
> the ADO reference.
> >Check Microsoft DAO 3.6.  Access 2000 converts with ADO
> reference by
> >default.



> >> I have converted a database from Access 97 to Access
> 2000,
> >> and everything works prefectly apart from the code.  I
> get
> >> the message 'Compile error: User-defined type not
> >> defined'.  I have looked at the types, which
> >> are 'Database' and 'Table', i looked in the object
> browser
> >> of VB in Access 2000 and they are not there, so now, the
> >> code will not compile and run.  Is there something else
> i
> >> can use instead of this?

> >> Thanks

> >.



Mon, 06 Jun 2005 00:46:37 GMT  
 Transfer of Coding from Access 97 to Access 2000
It worked perfectly in Access 97, here is the code;

Function addnewrec()
Dim mydb As Database, mytable As Table, transtable As Table
Set mydb = CurrentDb()
Set mytable = mydb.OpenTable("prem_uk")
Set transtable = mydb.OpenTable("trans")
mytable.Index = primarykey
Do Until transtable.EOF
    mytable.AddNew
    mytable("title") = transtable("title")
    mytable("initial") = transtable("initial")
    mytable("First name") = transtable("first name")
    mytable("position") = transtable("position")
    mytable("surname") = transtable("surname")
    mytable("company") = transtable("comapny")
    mytable("address1") = transtable("address1")
    mytable("address2") = transtable("address2")
    mytable("e-mail") = transtable("Email address")
    mytable("town") = transtable("town")
    mytable("county") = transtable("county")
    mytable("post code") = transtable("postcode")
    mytable("telephone") = transtable("telephone")
    mytable("fax") = transtable("fax")
    mytable("Salesperson") = transtable("Salesperson")
    mytable("history") = transtable("history")
    mytable("source") = transtable("source")
    mytable("FirstContactDate") = transtable
("FirstContactDate")
    mytable("CALL BACK") = transtable("CALL BACK")
    mytable("ProspectID") = transtable("prospectID")
    mytable("Customer Type") = "P99 ???"
    mytable("ATS number") = Null
    mytable("PurchaseDate") = Date
    mytable.Update
    transtable.MoveNext
Loop
mytable.Close
transtable.Close
End Function

Quote:
>-----Original Message-----
>There is no data type called Table.  Did this work before
being converted
>(doubtful).   Post your code.  It probably should be
TableDef.



>> I just did this, and its not working, the compiler is
now
>> moving onto the next type, which is 'Table', any ideas?
>> >-----Original Message-----
>> >Open any code module.  Select Tools|References.  
Uncheck
>> the ADO reference.
>> >Check Microsoft DAO 3.6.  Access 2000 converts with ADO
>> reference by
>> >default.



>> >> I have converted a database from Access 97 to Access
>> 2000,
>> >> and everything works prefectly apart from the code.  
I
>> get
>> >> the message 'Compile error: User-defined type not
>> >> defined'.  I have looked at the types, which
>> >> are 'Database' and 'Table', i looked in the object
>> browser
>> >> of VB in Access 2000 and they are not there, so now,
the
>> >> code will not compile and run.  Is there something
else
>> i
>> >> can use instead of this?

>> >> Thanks

>> >.

>.



Mon, 06 Jun 2005 01:05:31 GMT  
 Transfer of Coding from Access 97 to Access 2000
Change Table to Recordset
Change OpenTable to OpenRecordset

It appears your code was originally written in an older version of Access.


Quote:
> It worked perfectly in Access 97, here is the code;

> Function addnewrec()
> Dim mydb As Database, mytable As Table, transtable As Table
> Set mydb = CurrentDb()
> Set mytable = mydb.OpenTable("prem_uk")
> Set transtable = mydb.OpenTable("trans")
> mytable.Index = primarykey
> Do Until transtable.EOF
>     mytable.AddNew
>     mytable("title") = transtable("title")
>     mytable("initial") = transtable("initial")
>     mytable("First name") = transtable("first name")
>     mytable("position") = transtable("position")
>     mytable("surname") = transtable("surname")
>     mytable("company") = transtable("comapny")
>     mytable("address1") = transtable("address1")
>     mytable("address2") = transtable("address2")
>     mytable("e-mail") = transtable("Email address")
>     mytable("town") = transtable("town")
>     mytable("county") = transtable("county")
>     mytable("post code") = transtable("postcode")
>     mytable("telephone") = transtable("telephone")
>     mytable("fax") = transtable("fax")
>     mytable("Salesperson") = transtable("Salesperson")
>     mytable("history") = transtable("history")
>     mytable("source") = transtable("source")
>     mytable("FirstContactDate") = transtable
> ("FirstContactDate")
>     mytable("CALL BACK") = transtable("CALL BACK")
>     mytable("ProspectID") = transtable("prospectID")
>     mytable("Customer Type") = "P99 ???"
>     mytable("ATS number") = Null
>     mytable("PurchaseDate") = Date
>     mytable.Update
>     transtable.MoveNext
> Loop
> mytable.Close
> transtable.Close
> End Function

> >-----Original Message-----
> >There is no data type called Table.  Did this work before
> being converted
> >(doubtful).   Post your code.  It probably should be
> TableDef.



> >> I just did this, and its not working, the compiler is
> now
> >> moving onto the next type, which is 'Table', any ideas?
> >> >-----Original Message-----
> >> >Open any code module.  Select Tools|References.
> Uncheck
> >> the ADO reference.
> >> >Check Microsoft DAO 3.6.  Access 2000 converts with ADO
> >> reference by
> >> >default.



> >> >> I have converted a database from Access 97 to Access
> >> 2000,
> >> >> and everything works prefectly apart from the code.
> I
> >> get
> >> >> the message 'Compile error: User-defined type not
> >> >> defined'.  I have looked at the types, which
> >> >> are 'Database' and 'Table', i looked in the object
> >> browser
> >> >> of VB in Access 2000 and they are not there, so now,
> the
> >> >> code will not compile and run.  Is there something
> else
> >> i
> >> >> can use instead of this?

> >> >> Thanks

> >> >.

> >.



Mon, 06 Jun 2005 01:07:24 GMT  
 Transfer of Coding from Access 97 to Access 2000
Thanks, it works, but as it it linked to another piece of
coding, this is not working now; (the 'myquery As Dynaset')

Function remtranslead
()                                         'sets the name
of the function
Dim mydb As Database, mytable As Recordset, myquery As
Dynaset
Set mydb = CurrentDb()
Set mytable = mydb.OpenRecordset
("premier1")                      
Set myquery = mydb.CreateDynaset
("remtrans")                   '
Do Until myquery.EOF
    myquery.Delete
    myquery.MoveNext
Loop
myquery.Close
mytable.Close
End Function

Quote:
>-----Original Message-----
>Change Table to Recordset
>Change OpenTable to OpenRecordset

>It appears your code was originally written in an older
version of Access.



>> It worked perfectly in Access 97, here is the code;

>> Function addnewrec()
>> Dim mydb As Database, mytable As Table, transtable As
Table
>> Set mydb = CurrentDb()
>> Set mytable = mydb.OpenTable("prem_uk")
>> Set transtable = mydb.OpenTable("trans")
>> mytable.Index = primarykey
>> Do Until transtable.EOF
>>     mytable.AddNew
>>     mytable("title") = transtable("title")
>>     mytable("initial") = transtable("initial")
>>     mytable("First name") = transtable("first name")
>>     mytable("position") = transtable("position")
>>     mytable("surname") = transtable("surname")
>>     mytable("company") = transtable("comapny")
>>     mytable("address1") = transtable("address1")
>>     mytable("address2") = transtable("address2")
>>     mytable("e-mail") = transtable("Email address")
>>     mytable("town") = transtable("town")
>>     mytable("county") = transtable("county")
>>     mytable("post code") = transtable("postcode")
>>     mytable("telephone") = transtable("telephone")
>>     mytable("fax") = transtable("fax")
>>     mytable("Salesperson") = transtable("Salesperson")
>>     mytable("history") = transtable("history")
>>     mytable("source") = transtable("source")
>>     mytable("FirstContactDate") = transtable
>> ("FirstContactDate")
>>     mytable("CALL BACK") = transtable("CALL BACK")
>>     mytable("ProspectID") = transtable("prospectID")
>>     mytable("Customer Type") = "P99 ???"
>>     mytable("ATS number") = Null
>>     mytable("PurchaseDate") = Date
>>     mytable.Update
>>     transtable.MoveNext
>> Loop
>> mytable.Close
>> transtable.Close
>> End Function

>> >-----Original Message-----
>> >There is no data type called Table.  Did this work
before
>> being converted
>> >(doubtful).   Post your code.  It probably should be
>> TableDef.



>> >> I just did this, and its not working, the compiler is
>> now
>> >> moving onto the next type, which is 'Table', any
ideas?
>> >> >-----Original Message-----
>> >> >Open any code module.  Select Tools|References.
>> Uncheck
>> >> the ADO reference.
>> >> >Check Microsoft DAO 3.6.  Access 2000 converts with
ADO
>> >> reference by
>> >> >default.



>> >> >> I have converted a database from Access 97 to
Access
>> >> 2000,
>> >> >> and everything works prefectly apart from the
code.
>> I
>> >> get
>> >> >> the message 'Compile error: User-defined type not
>> >> >> defined'.  I have looked at the types, which
>> >> >> are 'Database' and 'Table', i looked in the object
>> >> browser
>> >> >> of VB in Access 2000 and they are not there, so
now,
>> the
>> >> >> code will not compile and run.  Is there something
>> else
>> >> i
>> >> >> can use instead of this?

>> >> >> Thanks

>> >> >.

>> >.

>.



Mon, 06 Jun 2005 01:20:58 GMT  
 Transfer of Coding from Access 97 to Access 2000
Change CreateDynaset to Openrecordset

Definitely old code


Quote:
> Thanks, it works, but as it it linked to another piece of
> coding, this is not working now; (the 'myquery As Dynaset')

> Function remtranslead
> ()                                         'sets the name
> of the function
> Dim mydb As Database, mytable As Recordset, myquery As
> Dynaset
> Set mydb = CurrentDb()
> Set mytable = mydb.OpenRecordset
> ("premier1")
> Set myquery = mydb.CreateDynaset
> ("remtrans")                   '
> Do Until myquery.EOF
>     myquery.Delete
>     myquery.MoveNext
> Loop
> myquery.Close
> mytable.Close
> End Function

> >-----Original Message-----
> >Change Table to Recordset
> >Change OpenTable to OpenRecordset

> >It appears your code was originally written in an older
> version of Access.



> >> It worked perfectly in Access 97, here is the code;

> >> Function addnewrec()
> >> Dim mydb As Database, mytable As Table, transtable As
> Table
> >> Set mydb = CurrentDb()
> >> Set mytable = mydb.OpenTable("prem_uk")
> >> Set transtable = mydb.OpenTable("trans")
> >> mytable.Index = primarykey
> >> Do Until transtable.EOF
> >>     mytable.AddNew
> >>     mytable("title") = transtable("title")
> >>     mytable("initial") = transtable("initial")
> >>     mytable("First name") = transtable("first name")
> >>     mytable("position") = transtable("position")
> >>     mytable("surname") = transtable("surname")
> >>     mytable("company") = transtable("comapny")
> >>     mytable("address1") = transtable("address1")
> >>     mytable("address2") = transtable("address2")
> >>     mytable("e-mail") = transtable("Email address")
> >>     mytable("town") = transtable("town")
> >>     mytable("county") = transtable("county")
> >>     mytable("post code") = transtable("postcode")
> >>     mytable("telephone") = transtable("telephone")
> >>     mytable("fax") = transtable("fax")
> >>     mytable("Salesperson") = transtable("Salesperson")
> >>     mytable("history") = transtable("history")
> >>     mytable("source") = transtable("source")
> >>     mytable("FirstContactDate") = transtable
> >> ("FirstContactDate")
> >>     mytable("CALL BACK") = transtable("CALL BACK")
> >>     mytable("ProspectID") = transtable("prospectID")
> >>     mytable("Customer Type") = "P99 ???"
> >>     mytable("ATS number") = Null
> >>     mytable("PurchaseDate") = Date
> >>     mytable.Update
> >>     transtable.MoveNext
> >> Loop
> >> mytable.Close
> >> transtable.Close
> >> End Function

> >> >-----Original Message-----
> >> >There is no data type called Table.  Did this work
> before
> >> being converted
> >> >(doubtful).   Post your code.  It probably should be
> >> TableDef.



> >> >> I just did this, and its not working, the compiler is
> >> now
> >> >> moving onto the next type, which is 'Table', any
> ideas?
> >> >> >-----Original Message-----
> >> >> >Open any code module.  Select Tools|References.
> >> Uncheck
> >> >> the ADO reference.
> >> >> >Check Microsoft DAO 3.6.  Access 2000 converts with
> ADO
> >> >> reference by
> >> >> >default.



> >> >> >> I have converted a database from Access 97 to
> Access
> >> >> 2000,
> >> >> >> and everything works prefectly apart from the
> code.
> >> I
> >> >> get
> >> >> >> the message 'Compile error: User-defined type not
> >> >> >> defined'.  I have looked at the types, which
> >> >> >> are 'Database' and 'Table', i looked in the object
> >> >> browser
> >> >> >> of VB in Access 2000 and they are not there, so
> now,
> >> the
> >> >> >> code will not compile and run.  Is there something
> >> else
> >> >> i
> >> >> >> can use instead of this?

> >> >> >> Thanks

> >> >> >.

> >> >.

> >.



Mon, 06 Jun 2005 01:25:44 GMT  
 Transfer of Coding from Access 97 to Access 2000
Definitely not A97.  Not 100% sure but I don't think it is A95 either.

--
HTH
Van T. Dinh
MVP (Access)


Quote:
> Change CreateDynaset to Openrecordset

> Definitely old code



Mon, 06 Jun 2005 18:26:04 GMT  
 Transfer of Coding from Access 97 to Access 2000
Change Dynaset to DAO.Recordset

--
HTH
Van T. Dinh
MVP (Access)


Quote:
> When compiling this, i still get an error message on
> saying user type not defined on the part 'myquery As
> Dynaset'.

> this was written in a older version of Access.



Mon, 06 Jun 2005 18:50:05 GMT  
 Transfer of Coding from Access 97 to Access 2000
When compiling this, i still get an error message on
saying user type not defined on the part 'myquery As
Dynaset'.

this was written in a older version of Access.

Quote:
>-----Original Message-----
>Change CreateDynaset to Openrecordset

>Definitely old code



>> Thanks, it works, but as it it linked to another piece
of
>> coding, this is not working now; (the 'myquery As
Dynaset')

>> Function remtranslead
>> ()                                         'sets the
name
>> of the function
>> Dim mydb As Database, mytable As Recordset, myquery As
>> Dynaset
>> Set mydb = CurrentDb()
>> Set mytable = mydb.OpenRecordset
>> ("premier1")
>> Set myquery = mydb.CreateDynaset
>> ("remtrans")                   '
>> Do Until myquery.EOF
>>     myquery.Delete
>>     myquery.MoveNext
>> Loop
>> myquery.Close
>> mytable.Close
>> End Function

>> >-----Original Message-----
>> >Change Table to Recordset
>> >Change OpenTable to OpenRecordset

>> >It appears your code was originally written in an older
>> version of Access.



>> >> It worked perfectly in Access 97, here is the code;

>> >> Function addnewrec()
>> >> Dim mydb As Database, mytable As Table, transtable As
>> Table
>> >> Set mydb = CurrentDb()
>> >> Set mytable = mydb.OpenTable("prem_uk")
>> >> Set transtable = mydb.OpenTable("trans")
>> >> mytable.Index = primarykey
>> >> Do Until transtable.EOF
>> >>     mytable.AddNew
>> >>     mytable("title") = transtable("title")
>> >>     mytable("initial") = transtable("initial")
>> >>     mytable("First name") = transtable("first name")
>> >>     mytable("position") = transtable("position")
>> >>     mytable("surname") = transtable("surname")
>> >>     mytable("company") = transtable("comapny")
>> >>     mytable("address1") = transtable("address1")
>> >>     mytable("address2") = transtable("address2")
>> >>     mytable("e-mail") = transtable("Email address")
>> >>     mytable("town") = transtable("town")
>> >>     mytable("county") = transtable("county")
>> >>     mytable("post code") = transtable("postcode")
>> >>     mytable("telephone") = transtable("telephone")
>> >>     mytable("fax") = transtable("fax")
>> >>     mytable("Salesperson") = transtable
("Salesperson")
>> >>     mytable("history") = transtable("history")
>> >>     mytable("source") = transtable("source")
>> >>     mytable("FirstContactDate") = transtable
>> >> ("FirstContactDate")
>> >>     mytable("CALL BACK") = transtable("CALL BACK")
>> >>     mytable("ProspectID") = transtable("prospectID")
>> >>     mytable("Customer Type") = "P99 ???"
>> >>     mytable("ATS number") = Null
>> >>     mytable("PurchaseDate") = Date
>> >>     mytable.Update
>> >>     transtable.MoveNext
>> >> Loop
>> >> mytable.Close
>> >> transtable.Close
>> >> End Function

>> >> >-----Original Message-----
>> >> >There is no data type called Table.  Did this work
>> before
>> >> being converted
>> >> >(doubtful).   Post your code.  It probably should be
>> >> TableDef.



>> >> >> I just did this, and its not working, the
compiler is
>> >> now
>> >> >> moving onto the next type, which is 'Table', any
>> ideas?
>> >> >> >-----Original Message-----
>> >> >> >Open any code module.  Select Tools|References.
>> >> Uncheck
>> >> >> the ADO reference.
>> >> >> >Check Microsoft DAO 3.6.  Access 2000 converts
with
>> ADO
>> >> >> reference by
>> >> >> >default.


message



- Show quoted text -

Quote:
>> >> >> >> I have converted a database from Access 97 to
>> Access
>> >> >> 2000,
>> >> >> >> and everything works prefectly apart from the
>> code.
>> >> I
>> >> >> get
>> >> >> >> the message 'Compile error: User-defined type
not
>> >> >> >> defined'.  I have looked at the types, which
>> >> >> >> are 'Database' and 'Table', i looked in the
object
>> >> >> browser
>> >> >> >> of VB in Access 2000 and they are not there, so
>> now,
>> >> the
>> >> >> >> code will not compile and run.  Is there
something
>> >> else
>> >> >> i
>> >> >> >> can use instead of this?

>> >> >> >> Thanks

>> >> >> >.

>> >> >.

>> >.

>.



Mon, 06 Jun 2005 18:43:33 GMT  
 
 [ 11 post ] 

 Relevant Pages 

1. Creating new Access 97 database by VB code in Access 2000 module

2. Access 97 upgrade to Access 2000 or Access 2002

3. Converting from Access 97 to 2000 - Visual Basic Code

4. Import From Excel 2000 with VBA code into Access 97

5. Conversion error from Access 2000 to Access 97

6. Convert Access 97 db to Access 2000 db in VB6

7. DLL usage - works in Access 97 but not in Access 2000

8. Access 97 VBA modifications not visible in Access 2000

9. Program from access 97 won't work in access 2000

10. Access 97 and Access 2000 on the Same Computer

11. Using VBA to Convert Access 2000 database to Access 97

12. vba access 97 -> access 2000

 

 
Powered by phpBB® Forum Software