I'm afraid it is still not working so I must be doing something wrong elsewhere.
Below is the order that I am calling things:
Set LegalServiceDB = CurrentDb
'Get the current version of the query that is used by the crosstab query
Set queryDefinition = LegalServiceDB.QueryDefs("TotalFileCountByNameAndType_Crosstab")
'Set the new SQL string
queryDefinition.SQL = sqlQuery
queryDefinition.Close
LegalServiceDB.Close
Set queryDefinition = Nothing
Set LegalServiceDB = Nothing
Call FixCrosstabOrder
Me.TotalFileCount_SubForm.SourceObject = "Query.TotalFileCountByNameAndType_Crosstab"
I will create a new Access file and just create this query to see if I can see what I am doing wrong.
Thanks for all of your help.
Below is the order that I am calling things:
Set LegalServiceDB = CurrentDb
'Get the current version of the query that is used by the crosstab query
Set queryDefinition = LegalServiceDB.QueryDefs("TotalFileCountByNameAndType_Crosstab")
'Set the new SQL string
queryDefinition.SQL = sqlQuery
queryDefinition.Close
LegalServiceDB.Close
Set queryDefinition = Nothing
Set LegalServiceDB = Nothing
Call FixCrosstabOrder
Me.TotalFileCount_SubForm.SourceObject = "Query.TotalFileCountByNameAndType_Crosstab"
I will create a new Access file and just create this query to see if I can see what I am doing wrong.
Thanks for all of your help.