Hello Everyone
I want to design a form that displays the picture of the product that are being placed in an order.
So for example, I have the following tables:
tblCustomers
CustomerID CustomerName 1 John 2 Gorge 3 Lisa
tblProducts
ProductID ProductName ProductPicture 1 Product A C:\ ProductPicture\ProductA.jpeg 2 Product B C:\ ProductPicture\ProductB.jpeg 3 Product C C:\ ProductPicture\ProductC.jpeg
tblOrders
OrderID CustomerID 1 1 2 1 3 2
tblOrderDetails
OrderID ProductID Quantity 1 1 10 1 2 5 2 1 20 2 3 15 3 3 100
Then for the user interface, I have a main form and a subform inside the main form. The main form uses the tblOrders as a record source. The subform uses the tblOrderDetails as a record source. After the user enters the order id and customer id on the main form, the focus moves to the subform to select the products for that order. At this point I want the picture of the product to be shown on the main form or subform. So when the user clicks on the down arrow of the combo box and selects for example product A, I want the picture of product A to be shown on the Form.
I am not planning to store the pictures in my database as an OLE object, because I have many products and I will be using my database on a network, and I have read somewhere that this might slow down the response of my database.
So I am planning to put an image control on the form and set its control source property to the file path of the product picture that is being selected on the subform. The problem that I was not able to solve is the record source of the subform is tblOrdersDetails and the file path of the product picture is stored on the tblProducts table.
I hope that this makes sense, if the narrative description is not clear, then I have included a sample database.