I have a database for my shop order, i use a combo box to select the
product the customer has bought, but i am finding it very slow to load
as i am running it as a ODB conection to MY sql and i have about 300
products now
Is there a better way ti select the product the customer has bought
instead od a combo box
Thanks
SImon
Don't automatically blame the combobox control for its slowness to
load.
Look at the following factors:
--the speed at which the query executes on the remote database;
--the amount of data that the query returns;
--and the speed of the network.
I'll presume that the customer is uniquely identified in the
tblCustomers by CustomerID. Further, that the customer's order are
maintained in a tblInvoices table, uniquely identified by the
composite key of CustomerID and InvoiceID. This tblInvoices table has
a field called ProductID. And lastly, there is referential integrity
between the tblInvoices.ProductID and the tblProducts.ProductID.
Thus, the Row Source for the combobox could be the query:
SELECT DISTINCT ProductID, ProductDescription
from tblProducts
where ProductID in
( SELECT ProductID
from tblInvoices
where CustomerID = Me!CustomerID.value )
Here, the smallest amount of data has been returned, reducing network
traffic. Many factors beyond your control cause determine the speed
of a network. Instead, focus on what you can control.