I have a class module that does some account reconciliation and billing. I've recently split the db, and the following code no longer works:
Public Function GenAR(strEntID As String)
'Generates an organizational invoice based on a specified Org ID. Can be used stand alone
'or within the BillActivityList() function
Dim dbInvoice As Database
Dim rsTraining As Recordset, rsConsulting As Recordset
Dim rsOrgInvoice As Recordset, rsCrsList As Recordset, strTrngSQL As String
Dim strCntCSQL As String, strInvoiceNum As String, bolIsMemb As Boolean
Dim strCurOrgID As String
Dim dblAmtDue As Double, intEntLeft As Integer, dblEntLeftValue As Double
Dim intEntPDue As Integer, dblThisCrsDiscount As Double, intPntsUsed As Integer
Dim dblInvDiscnt As Double, strMembSQL As String, rsMembership As Recordset
Dim strUpDtMembSQL As String
strMembSQL = "SELECT [Org Membership].[Org ID], [Org Membership].[Renew Date], [Org Membership].[Mem Status], "
strMembSQL = strMembSQL & "[Org Membership].[Remaining Points] FROM [Org Membership] "
strMembSQL = strMembSQL & "WHERE ((([Org Membership].[Renew Date]) >= #" & Str(dtEndDate - intDateOffset) & "#))"
strMembSQL = strMembSQL & " ORDER BY [Org Membership].[Org ID], [Org Membership].[Renew Date];"
'Open the general databases and recordsets
Set dbInvoice = CurrentDb
Set rsOrgInvoice = dbInvoice.OpenRecordset("Org Invoice", dbOpenTable)
Set rsMembership = dbInvoice.OpenRecordset(strMembSQL)
Set rsCrsList = dbInvoice.OpenRecordset("Crs List")
rsCrsList.Index = "PrimaryKey"
'Initialize list of Org IDs with billable activity
rsOrgInvoice.Index = "PrimaryKey"
rsOrgInvoice.MoveLast ' Get last invoice number
The .index is no longer supported on this type of object.
What's the best way to fix this? I suppose I could declare a workspace for the linked db, but would executing as an SQL statement do as well?