Please excuse my ignorance. I must be doing something wrong and it is so
simple that I cannot see it! Below is the SQL for a form that is working
correctly. (I did not design this so I am not understanding why it is not
working when I change it.)
SELECT DISTINCTROW [Order Details].OrderDetailID, [Order Details].OrderID,
[Order Details].LineItem, [Order Details].ProductID, [Order
Details].SerialNum, [Order Details].Quantity, [Order Details].UnitPrice,
[Order Details].Discount, Round([Quantity]*[Order
Details].UnitPrice*(1-[Discount]),2) AS [Line Total], Products.ProductCode,
[HandlingPct]*Round([Quantity]*[Order Details].UnitPrice*(1-[Discount]),2)
AS HandlingChg, [Order Details].Notes
FROM Products INNER JOIN [Order Details] ON Products.ProductID = [Order
Details].ProductID
ORDER BY [Order Details].LineItem;
This form has a combo box for Product Description.
SELECT DISTINCTROW Products.*
FROM Products
ORDER BY Products.ProductName;
When I attempt to change this where the combo box is on Product Code, then I
can no longer enter a line item, and I am getting incorrect info in the
product code box.
I have looked at access help, but cannot see what I am doing wrong.
Thank you.
Mr B said:
You may have used the QBE incorrectly. Just use it to design a query
just
as
you would design any other query. Then when you close the QBE, Access will
use the SQL statement from the QBE to build the correct statement in the Row
Source for your combo box.
The statement in the Row Source property of your combo box will actually
look something like:
SELECT tblProducts.Product, tblProducts.Description, tblProducts.Price FROM
tblProducts;
If you have more problems using the QBE, take a look in the Access help file.
Any combo box or list simply uses an SQL statement to return the list that
it then displays. These SQL statements can be quite simple or very complex.
--
HTH
Mr B
=[Products]![ProductCode][Products]!ProductDescription][Products]!ProductUni
tPrice]
Or
since this is based upon the products table: =
[ProductCode][ProductDescription][ProductUnitPrice]
I was unable to continue past this due to the error.
Thank you in advance.
To accomplish what you want, add a combo box to your form. Right click on
the combo box and select the Properties optons to display the Properties
of
the combo box. On the Data tab place your cursor in the Row Source field.
You will see a button with three dots at the right end of the field. Click
the button to display the QBE window. Add the Products table to the QBE.
Then
place the Product Code field, then the Description field and then
the
dialog