Hi all,
I hope someone can help. I use an ADO function to sort and rank a table which worked fine in my old Access 2003 setup. I now have a new machine and I've upgraded to Access 2007 and I'm finding the function doesn't work.
My suspicion is that I'm missing an ADO reference, but don't know and can't find how to set it in Access 2007 (e.g. my add-in manager is greyed out)
When I run the function I get the error "Compile Error: User-defined type not defined" on the bold line below, which is shown in the extract from the function below.
Public Function SalesMfgDescRank(strSalesRankType As String)
Dim rs As ADODB.Recordset
Dim conn As ADODB.Connection
Dim lngSalesRank As Long
Dim ssql As String
Dim strCurrentSKU As String
Dim strCheckSameSKU As String
Dim lngCurrentRow As Long
' Set Connections but do not open them yet
Set rs = New ADODB.Recordset
Set conn = CurrentProject.Connection
rs.ActiveConnection = conn
'Must set cursor location to be adUseClient to be able to sort the table
rs.CursorLocation = adUseClient
Thanks,
Henry
I hope someone can help. I use an ADO function to sort and rank a table which worked fine in my old Access 2003 setup. I now have a new machine and I've upgraded to Access 2007 and I'm finding the function doesn't work.
My suspicion is that I'm missing an ADO reference, but don't know and can't find how to set it in Access 2007 (e.g. my add-in manager is greyed out)
When I run the function I get the error "Compile Error: User-defined type not defined" on the bold line below, which is shown in the extract from the function below.
Public Function SalesMfgDescRank(strSalesRankType As String)
Dim rs As ADODB.Recordset
Dim conn As ADODB.Connection
Dim lngSalesRank As Long
Dim ssql As String
Dim strCurrentSKU As String
Dim strCheckSameSKU As String
Dim lngCurrentRow As Long
' Set Connections but do not open them yet
Set rs = New ADODB.Recordset
Set conn = CurrentProject.Connection
rs.ActiveConnection = conn
'Must set cursor location to be adUseClient to be able to sort the table
rs.CursorLocation = adUseClient
Thanks,
Henry