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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch error

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
I'm running the following code below and keep getting a type mismatch error in the open recordset statement. Code copied from:
Option Explicit

Dim DB As Database
Dim GrpPages As Recordset



Public Function GetGrpPages()
GrpPages.Seek "=", Me![CategoryName]
If Not GrpPages.NoMatch Then
GetGrpPages = Me.Page & "/" & GrpPages![Page Number]
End If
End Function



Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
Me.Page = 1
End Sub

Private Sub PageFooter_Format(Cancel As Integer, FormatCount As Integer)
GrpPages.Seek "=", Me![CategoryName]
If Not GrpPages.NoMatch Then
If GrpPages![Page Number] < Me.Page Then
GrpPages.Edit
GrpPages![Page Number] = Me.Page
GrpPages.Update
End If
Else

GrpPages.AddNew
GrpPages![CategoryName] = Me![CategoryName]
GrpPages![Page Number] = Me.Page
GrpPages.Update
End If
End Sub

Private Sub Report_Open(Cancel As Integer)
Set DB = DBEngine.Workspaces(0).Databases(0)
DoCmd.RunSQL &quot;Delete * From [Category Group Pages];&quot;
Set GrpPages = DB.OpenRecordset(&quot;Category Group Pages&quot;, DB_OPEN_TABLE) 'Run-time 'error '13' type mismatch
GrpPages.Index = &quot;PrimaryKey&quot; ' What's up?
End Sub
 
Go to the knowledgebase and search for Q209215


Your article was for version 2.0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top