Query in a form?!

pelicanbuyer

Registered User.
Local time
Yesterday, 23:00
Joined
Dec 11, 2012
Messages
12
Newbie to Access...

I have created a form to display the information in a table and it all comes up 'fine and dandy'!

Now i want to have a field on the form that calculates 2 table values...

e.g. Cost price divided by units per pack purchased. (To work out cost price per unit)

I am very confident with excel but understand from looking through the forms that a query is the way to go. I just don't know how to create the query and then how to show the answer for the individual record on the form.

The question...

How do I (using best practise) find the sum I need from both of the fields on the form and show a total in a new text box? Better still how is it then logged in the original table.

HELP!!!!
 
If the "Cost price" and "units per pack" data are shown on the form, then all you need is a new, unbound text box, formatted as Currency, with an expression as it's Record Source. Something like:
= [Cost Price]/[units per pack]

The result should NOT be stored in a table. It should be calculated, whenever and where ever it is required.
 
I did do that and it worked thank you. However, how do I get it to log the result in the table as I want to then use this data on another form without having to do the calculation again. In addition, on the new form I wanted to create a combo box to select a value and then show the result of the calculation for the item I pick.

To elaborate a bit, form 1 displays the cost of items I purchase from a food wholesaler. e.g. a bottle of oil which is 5 litres.... the second form displays individual dish costings where I want to select the oil and then say I only want 1 litre in the recipe. I wanted to have how much 1ml of oil costs in the table and then multiply that by the number I enter on the dish costing form.

I hope this makes some kind of sense!!!!
 
As I said in my last post
The result should NOT be stored in a table. It should be calculated, whenever and where ever it is required.
So, do the calculation in the new form (or a query that it is bound to).
 
OK will do.

So to help me in second form, what would be done to the unbound text field to ask it to calculate cost/units from a selection on a combo box please?
 

Users who are viewing this thread

Back
Top Bottom