Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mis Match 1

Status
Not open for further replies.
May 5, 2002
79
US
I am using one of the Microsoft Report Examples (Phone book type headers). The code is:

Private Sub ReportFooter4_Format(Cancel As Integer, FormatCount As Integer)

Dim dbs As Database
Dim rst As Recordset

' Set flag after first pass has been completed.
gLastPage = True

' Open recordset for report.
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(&quot;qryBuddyByLastName&quot;, dbOpenDynaset)<==== FAILS WITH TYPE MISMATCH.
' Move to last record in recordset.
rst.MoveLast
' Enter last record into array.
ReDim Preserve gLast(Reports!rptHunterPhoneList.Page + 1)
gLast(Reports!rptHunterPhoneList.Page) = rst!LastName

End Sub

What type mismatch is occuring? Is there a special object library that must be in references?

Help would be greatly appreciated.
 
Hi,

Try verifiying your references and make sure that
Microsoft DAO 2.5/3.5 compatibility Librairy
is checked.

It solved a similar problem I once add.

Hope it helps you! Salvatore Grassagliata
 
Once you have the DAO reference set it is a good idea to qualify the objects you are using with the DAO library name since some ADO objects have the same names, which causes the mismatches.


Dim dbs As DAO.Database
Dim rst As DAO.Recordset
 
Explicitly naming the database and recordset as DAO was the perfect solution. Many thanks !!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top