Hi. Hope someone can advise. The code below is an example of a larger set of code blocks used to populate a complicated report. It used to work fine in Access 2003, but after upgrading to 2007 it no longer works – and I haven’t changed anything since it worked fine. I get a Run-time error 13 "Type mismatch" for the line as highlighted. Any help would be much appreciated. M.
Private Sub Report_Activate()
Dim db As Database
Dim rsQuery As QueryDef
Dim rsQuerySet As Recordset
Set db = CurrentDb()
Dim TextResults As String
Dim numResults As Integer
Dim GroupResults As String
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Project ID Number
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Read PublicInvolvementFormLead query and enter Research ID field into resID field
Set rsQuery = db.QueryDefs![PublicInvolvementFormLead]
rsQuery![Forms!Research!resID] = Forms![research]![resID]
rsQuery![Forms!ResearchPI!GrantApplicant] = [Forms]![ResearchPI]![GrantApplicant]
Set rsQuerySet = rsQuery.OpenRecordset()
If IsNull(rsQuerySet("resID")) Then
numResults = Null
Else
numResults = rsQuerySet("resID")
End If
resID = numResults
Private Sub Report_Activate()
Dim db As Database
Dim rsQuery As QueryDef
Dim rsQuerySet As Recordset
Set db = CurrentDb()
Dim TextResults As String
Dim numResults As Integer
Dim GroupResults As String
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Project ID Number
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Read PublicInvolvementFormLead query and enter Research ID field into resID field
Set rsQuery = db.QueryDefs![PublicInvolvementFormLead]
rsQuery![Forms!Research!resID] = Forms![research]![resID]
rsQuery![Forms!ResearchPI!GrantApplicant] = [Forms]![ResearchPI]![GrantApplicant]
Set rsQuerySet = rsQuery.OpenRecordset()
If IsNull(rsQuerySet("resID")) Then
numResults = Null
Else
numResults = rsQuerySet("resID")
End If
resID = numResults