In order to improve the performance of a combobox and not allowing a combobox query to calculate anything I created a view in SQL Server where all the complex calculations are done. Now I want to open a recordset based on the same view since this view will be opened in memory , that means that I will gain in terms of the combobox performance.
The issue is how to link the opened recordset to the combobox, any idea is welcome:
Here is my final procedure and a subform combo box screen shoot for your easy reference. The combobox is called productid:
The issue is how to link the opened recordset to the combobox, any idea is welcome:
Here is my final procedure and a subform combo box screen shoot for your easy reference. The combobox is called productid:
Code:
Dim SQL As String
Dim db As DAO.Database
Dim rs AS DAO.Recordset
SQL = "SELECT DISTINCTROW ViewtblCustomerBiginvSelect.ProductID, ViewtblCustomerBiginvSelect.ProductName, ViewtblCustomerBiginvSelect.BarCode, ViewtblCustomerBiginvSelect.TaxClass, ViewtblCustomerBiginvSelect.Prices, ViewtblCustomerBiginvSelect.RRP, ViewtblCustomerBiginvSelect.VatRate, ViewtblCustomerBiginvSelect.Tourism, ViewtblCustomerBiginvSelect.Insurance, ViewtblCustomerBiginvSelect.TourismLevy, ViewtblCustomerBiginvSelect.TaxInclusive, ViewtblCustomerBiginvSelect.InsuranceRate, ViewtblCustomerBiginvSelect.InsuranceRate AS Premium, ViewtblCustomerBiginvSelect.ExportPrice, ViewtblCustomerBiginvSelect.NoTaxes, ViewtblCustomerBiginvSelect.Sales, ViewtblCustomerBiginvSelect.TurnoverTax, ViewtblCustomerBiginvSelect.Bettings, ViewtblCustomerBiginvSelect.Excise, ViewtblCustomerBiginvSelect.ExciseRate
FROM ViewtblCustomerBiginvSelect
WHERE (((ViewtblCustomerBiginvSelect.Sales)=Yes))
ORDER BY ViewtblCustomerBiginvSelect.ProductID DESC;"
Set rs = db.Openrecordset(SQL,dbOpenDynaset,dbSeeChanges)
Set Me.[sfrmLineDetails Subform].Form.Recordset = rs
rs.Close
Set rs = Nothing
Set db = Nothing