Something like the following in a code module:
Dim c As ADODB.Connection
Dim r As ADODB.Recordset
Const DB_PATH As String = "C:\mydb.mdb"
Sub Auto_Open()
Set c = New ADODB.Connection
c.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DB_PATH
End Sub
Sub Auto_Close()
If c.State = adStateOpen Then
c.Close
End If
Set c = Nothing
End Sub
Function SalesValue(ProductCode As String) As Double
If c.State = adStateClosed Then
Auto_Open
End If
Set r = c.Execute("select SalesValue from AccessTableName where ProductCode=" & ProductCode)
SalesValue = CDbl(r.Fields(0).Value)
End Function
You will need to edit the SQL query slightly to fit your table and column names and also set the DB_PATH constant for your db. Additionally I have assumed that sales value is a decimal amount and used a double to return it. Change as appropriate.
You can then call the funcytion in colB using