Results 1 to 2 of 2
2004-02-19, 19:11 #1
- Join Date
- Jan 2001
- Thanked 0 Times in 0 Posts
code problem: Stumped (Access 2000)
Very long piece of code moved to attachment by HansV.
Using code below to compare data between 2 tables. One table is the user table called tbl_Center and the other is a table that is of the data from tbl_Center right before the data was exported. It called VaryingTable. I import tbl_center into varyingtable right before the export to show the user changes made between the 2 tables. It saves the changes to a table called TableDiscrepancies2. I had this working great in access 97 but when I imported into access 2000 it works but at the end of the code when it's completed running it gives me a type mismatch error. I've checked all fields in both tables and made sure that they are indetical. Really stumped here. Any help is greatly appreciated. Thanks..
2004-02-19, 19:20 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: code problem: Stumped (Access 2000)
It might be confusion between DAO (the default data model in Access 97) and ADO (the default in Access 2000.)
Try prefixing the declarations of all DAO objects:
Dim db As DAO.Database
Dim rstBase As DAO.Recordset
Dim rstVarying As DAO.Recordset
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Strictly speaking, this is not necessary for Database and TableDef, because those are exclusively DAO objects, while Recordset and Field are both DAO and ADODB objects, but I prefer to be consistent.