Question : Recordset giving error invalid operation error

I have the code below and I am trying to create a query, the use it as a parameter in an OpenRecordset but I keep getting invalid operation error and I simply don't know why.  The database, recordset and connection variables are all set at the top of the module so they are available.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
Public Sub ReportGenerator(strAccount As String, strReportDate As String, strReportHeader As String)
Dim wbk As Excel.Workbook, wks As Excel.Worksheet
Dim rngStartRange As Excel.Range
Dim strIssues As String, rngIssues As Range, qdfIssues As QueryDef
Dim objExcel As Excel.Application
Set db = CurrentDb
strIssues = "SELECT Account, TopicHeader, Value1, Value2 " & _
    "FROM tblReportDataSource " & _
    "WHERE Account = '" & strAccount & "' AND TopicHeader IN('# Issues','Market Value ($B)') "
If DoesObjectExist("qryIssues", "Query") Then DoCmd.DeleteObject acQuery, "qryIssues"
Set qdfIssues = db.CreateQueryDef("qryIssues", strIssues)
Set rst = db.OpenRecordset("qryIssues", acQuery)

Set objExcel = New Excel.Application
objExcel.Visible = True
Set wbk = objExcel.Workbooks.Open("N:\US\US Client Relationship & Business Development\Client Reporting\Private\New Client Reporting\Client Service\Sandra\PROJECTS\JerrysProject\ReportTemplate.xls")
Set wks = wbk.ActiveSheet

    With wks
        .Range("FundNumber").value = "Fund Number " & strAccount
        .Range("ReportDate").value = "Period Ending " & strReportDate
        .Range("ReportHeader").value = strReportHeader
    End With
    
Set rngIssues = wks.Range("Issues")
    wks.Range("Issues").CopyFromRecordset rst
rst.Close

Answer : Recordset giving error invalid operation error

Just change the & into the XML acceptable value of &

Here are the reserved characters you have to change..
"   "
'   '
<   <
>   >
&   &amp;

<cfset cleanFirstName = replace(getinfo.FirstName,"&","&amp;","all")>
Random Solutions  
 
programming4us programming4us