Hi There.
Hopefully I can clearly explain my woe.
Problem:
I have a Main Form and a SubForm.
The SubForm contains fields to a table (Booking Item) that records -
Qty, Item ID, Booking_Id Description and Price.
The Subform source is a query that gets the details from the following Tables.
Booking Form (which is the Main Form) and Stock Info with the Price calculated by the Booking Item Qty and Item ID.
This structure works fine and the users are able to add new Booking Items from the Form - see attached Image1 (very simplified version)
The query for the above is:
HOWEVER
Here is the new requirements.
The Price for each Item will be depending on a special code that will be linked to each Customer.
So what I "thought" was the way to achieve this is to:
So I did so and set the correct data. Next was to tackle the query to calculate the new prices in consideration to the customer id within the Booking Form.
So, with the new structure in place I went to add the tables to the Query - attached is the query in the design view.
The Query created is below:
The Query runs fine as expected, except, I can not pdate rows or add new records via the SubForm.
I have so :banghead:at this point as I just can not for the life of me figure out how to achieve what I thought was a sound data structure to special prices to get to work on the subform.
Seriously, any help or if anyone has had the same experience would be fantastic!
Hopefully I can clearly explain my woe.
Problem:
I have a Main Form and a SubForm.
The SubForm contains fields to a table (Booking Item) that records -
Qty, Item ID, Booking_Id Description and Price.
The Subform source is a query that gets the details from the following Tables.
Booking Form (which is the Main Form) and Stock Info with the Price calculated by the Booking Item Qty and Item ID.
This structure works fine and the users are able to add new Booking Items from the Form - see attached Image1 (very simplified version)
The query for the above is:
Code:
SELECT DISTINCTROW [Job Details].Units,
[Job Details].[Stock code],
stock.DESCRIPTION,
[Job Details].job_id,
IIf(IsNull([Job Details].Price),STOCK.SALES_PRICE,[Job Details].Price) AS SALES_PRICE
FROM ([Job Details] INNER JOIN booking_form ON [Job Details].job_id=booking_form.job_id) INNER JOIN stock ON [Job Details].[Stock code]=stock.STOCK_CODE;
HOWEVER

Here is the new requirements.
The Price for each Item will be depending on a special code that will be linked to each Customer.
So what I "thought" was the way to achieve this is to:
- Create a new Table of PriceCode (autonumber) and description
- Create a second table containing all StockID, PriceCode and the new Price.
- Add a new field to the Customer table called PriceCode
So I did so and set the correct data. Next was to tackle the query to calculate the new prices in consideration to the customer id within the Booking Form.
So, with the new structure in place I went to add the tables to the Query - attached is the query in the design view.
The Query created is below:
Code:
SELECT DISTINCTROW [Job Details].Units, [Job Details].[Stock code], stock.DESCRIPTION, [Job Details].job_id, IIf(IsNull([Job Details].Price),Stock_PriceBand.Price,[Job Details].Price) AS SALES_PRICE
FROM ((([Job Details] INNER JOIN booking_form ON [Job Details].job_id = booking_form.job_id) INNER JOIN stock ON [Job Details].[Stock code] = stock.STOCK_CODE) INNER JOIN customers ON booking_form.customer_id = customers.customer_id) INNER JOIN Stock_PriceBand ON (Stock_PriceBand.StockID = stock.STOCK_CODE) AND (customer.PriceBandID = Stock_PriceBand.PriceBandID);
The Query runs fine as expected, except, I can not pdate rows or add new records via the SubForm.
I have so :banghead:at this point as I just can not for the life of me figure out how to achieve what I thought was a sound data structure to special prices to get to work on the subform.
Seriously, any help or if anyone has had the same experience would be fantastic!