Hi Martin,
On second thought, change the recordsource for the Order Details subform
so
that it includes the Nz function. This will prevent the #Error that one
sees
when they select a new item, but before they've entered the quantity:
SELECT OrderID, ProductID, Quantity, UnitPrice, Discount,
CCur(Nz([UnitPrice]*[Quantity]*(1-[Discount]))) AS Price
FROM [Order Details];
JUST until the moment I want to add a new order!
A pop-up then complains that I first have to enter a "PO-number". :-(
I believe you would have seen this on the original sample as well, since
the
PurchaseOrderNumber field in the Orders table is set for Required = Yes.
What is that? Is an end-user supposed to actualize some key-number??
Yes.
Can this perhaps be made to increment automatically.. and if so: how?
Yes, it can. Check out this sample on Access MVP Roger Carlson's web site:
http://www.rogersaccesslibrary.com/download3.asp?SampleName=AutonumberProblem.mdb
In this case, you could substitute this key for the Autonumber primary key
in the table. However, perhaps easier would be to just set a unique index
on
this new numeric field that you would add.
Another question would be:
I'd like to have the items which are OUT of stock, to be mentioned in red
font (in the Orders detail subform). Now I know this has to do something
with "conditional layout", but what exactly must be done to achieve this?
I think you have Conditional Formatting in mind. Try this modification to
the recordsource for the Order Details subform. We are adding the InStock
field from the Products table:
SELECT OrderID, ProductID, Quantity, UnitPrice, Discount,
CCur(Nz([Order Details].UnitPrice*[Quantity]*(1-[Discount]))) AS Price,
Products.InStock
FROM Products
INNER JOIN [Order Details] ON Products.ProductID=[Order
Details].ProductID;
Then, with the combo box selected in form design view, click on Format >
Conditional Formatting...
Add
Condition 1: Expression is [InStock]=0
and set the font color to red. You'll need to change the InStock value for
one or more Products in the Products table, in order to test this out.
This
will not change the font color of the items in the combo list itself--the
change will only be applied after you make a selection.
Tom Wickerath
Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
martin said:
Thanx a lot, Tom!
I followed the instructions and it works now...
JUST until the moment I want to add a new order!
A pop-up then complains that I first have to enter a "PO-number". :-(
What is that? Is an end-user supposed to actualize some key-number?? Can
this perhaps be made to increment automatically.. and if so: how?
Another question would be:
I'd like to have the items which are OUT of stock, to be mentioned in red
font (in the Orders detail subform). Now I know this has to do something
with "conditional layout", but what exactly must be done to achieve this?
Kind regards
martin