Dear MikeDU,
The reason you are getting a mismatch is that you are using DAO. ADO is the newer (and preferred) form of data access.
You may use either one, BUT you need to know the following caveat.
Recordset can be either DAO or ADO (ADODB). When Access 2000 (or later) sees "Recordset" it sets the default type as either ADODB or DAO depending upon which one is first in the reference list. This may vary from computer to computer - ie. the code you wrote may work on one machine and not on the next one.
The only way to guarantee that the correct type is used every time is to explicitly specify it as ADODB or DAO, for example:
Code:
Dim pay As ADODB.Recordset
or
Code:
Dim pay As DAO.Recordset
Other than hard coding the type (ADODB or DAO) or re-ordering the reference list on each computer, I don't know of any other way to force the default.
In your case, use the DAO type.
Once you specify the type explicitly, you must then make certain that the correct reference is installed on each computer that uses the code. If the reference is MISSING you will get a different error.
After getting bitten by this
feature many times, I now try to specify the data access type (DAO or ADODB) as above.
Rand