Cocktail Recipes (1 Viewer)

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
I don't know whether this is a query or table question, so am trying it here first.

I have a stock movement/consumption database and want to add cocktail recipes to it and am struggling.

I have attached a JPEG of the product table which is where everything lives. What I want to be able to do is build recipes using the existing products as ingredients and then feed the total back into the product table in the 'cocktail sales' column.

What I should be able to do is create a recipe using a form and enter up an amount of each product used in that recipe. The trouble is I can't get the consumption to relate to the product, I think I am making fairly basic errors.

I don't know what the basic structure should be, any help would be appreciated and could well save what is left of my hair :)

I'm using Access 2007
 

Attachments

  • Products.JPG
    Products.JPG
    48.9 KB · Views: 54

David Eagar

Registered User.
Local time
Today, 21:16
Joined
Jul 2, 2007
Messages
924
Something along these lines I think
 

Attachments

  • Bar.zip
    19.3 KB · Views: 87

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
Very much along those lines I think; thanks. I'm trying to extend it further than that though by feeding the consumption back into the product table.
 

David Eagar

Registered User.
Local time
Today, 21:16
Joined
Jul 2, 2007
Messages
924
OK, have added a Stock table & added to the Cocktails table - you would then need to build a query to calculate the amount of Drinks sold and reduce the amount of stock by that amount
 

Attachments

  • Bar.zip
    21.3 KB · Views: 65

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
This is brilliant, really gives me something to work with. I can't tell you how many blind alleys I have headed up trying to get this working
 

David Eagar

Registered User.
Local time
Today, 21:16
Joined
Jul 2, 2007
Messages
924
Well, if you're going to resort to flattery, I'll take my business elsewhere !!
Good luck
 

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
It was maintaining the integrity between the product and quantity that I couldn't get. I think all I need to do now is extend your logic and calculate total consumption per product, once I have that it should be easy enough to add the consumption back into my own product table.

I'm getting there, I think...
 

vbaInet

AWF VIP
Local time
Today, 12:16
Joined
Jan 22, 2010
Messages
26,374
Steve: I think I know where I will be getting my drinks from at such good rates;)
 

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
he is working in Aussie dollars though, by the time we convert to sterling and add our galactic new VAT rate...
 

vbaInet

AWF VIP
Local time
Today, 12:16
Joined
Jan 22, 2010
Messages
26,374
I thought pack size was litres :O

Yeah, I know. A rather steep rise. We'll survive.

Anyway, I will leave you to carry on with the work at hand :)
 

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
Ok, I'm getting there but am not quite...

I now have a query working out consumption with related product id numbers so that's a huge step forward. What I need now is to consolidate all the consumption of each product.

How would I go about adding up all the consumption of each instance of, for instance, product no 107 which appears in 3 x recipes and therefore has 3 x consumption amounts?

Much head scratching occurring over here today, many thanks for help.
 

Attachments

  • Consumption.JPG
    Consumption.JPG
    34.9 KB · Views: 66
  • Products.JPG
    Products.JPG
    44.7 KB · Views: 56

David Eagar

Registered User.
Local time
Today, 21:16
Joined
Jul 2, 2007
Messages
924
Added some new queries to a calculate usage and update stock - essentially it is a 'Group by Sum' and then Update query to adjust stock
 

Attachments

  • Bar.zip
    23.7 KB · Views: 89

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
There have been stiff drinks involved for a little while already; project slowing down considerably... :)
 

vbaInet

AWF VIP
Local time
Today, 12:16
Joined
Jan 22, 2010
Messages
26,374
There have been stiff drinks involved for a little while already; project slowing down considerably... :)
Go easy on the cocktails:D

When I first saw the title of your thread, "Cocktail Recipes", I thought you were offering some tips on recipes for cocktails. lol :p
 

SteveF

Registered User.
Local time
Today, 12:16
Joined
Jul 13, 2008
Messages
191
I'm very very close with this now, but I can't get the update query to work. I'm aware that storing calculated values is not usually the done thing but i'm using that value in another calculation so I really do need to calculate it and then store it.

Any help with updating a table with the result of a query?
 

David Eagar

Registered User.
Local time
Today, 21:16
Joined
Jul 2, 2007
Messages
924
You have caught me at a very bad time (see Watercooler/The Ashes and you will understand) also, in NOT keeping with the theme, I have had too much Aus premium wine -not cocktails....

At the back of my mind, update queries don't work when Group By are involved - Append do (ask Bill Gates why this is so)

Create a temp table - Append new values and then Upadte from temp table

Any other members following this post, correct me if I am wrong
 

vbaInet

AWF VIP
Local time
Today, 12:16
Joined
Jan 22, 2010
Messages
26,374
You have caught me at a very bad time (see Watercooler/The Ashes and you will understand) also, in NOT keeping with the theme, I have had too much Aus premium wine -not cocktails...
Premium!! The good stuff mmm...;)

At the back of my mind, update queries don't work when Group By are involved - Append do (ask Bill Gates why this is so)

Any other members following this post, correct me if I am wrong
Yes, even the Totals option isn't available. I also think you can't have a subset of records to update from in an Update statement in Access.

I was avoiding the mention of cricket :)
Don't worry, you can talk about cricket... I'm not watching it :)
 

Users who are viewing this thread

Top Bottom